Hi - i'm trying to connect to the a local pubs DB (SQL7).
Connection string is:
Public OledbPubsConnString As String = "Provider=SQLOLEDB.1;Data Source=(local);" _
& "User ID=sa;Password=sa;Initial Catalog=pubs"
' The connection to the Pubs database.
Dim cn As New OleDbConnection(OledbPubsConnString)
page load event call bindbooklist - which in turn open DB.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Me.IsPostBack Then
BindBookList()
End If
End Sub
Sub BindBookList()
' Open a connection to Pubs, if necessary.
If cn.State = ConnectionState.Closed Then cn.Open()
...
I get the following exeception when the cn.open() is executed:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Source Error:
Line 47: Sub BindBookList()
Line 48: ' Open a connection to Pubs, if necessary.
Line 49: If cn.State = ConnectionState.Closed Then cn.Open()
Line 50:
SQL is running, i don't understand what is going on - i sense that problem lies with the account 'sa'. Please explain, what do i need to change on the account to connect successfully. Thanks in advance. Mr K.
Connection string is:
Public OledbPubsConnString As String = "Provider=SQLOLEDB.1;Data Source=(local);" _
& "User ID=sa;Password=sa;Initial Catalog=pubs"
' The connection to the Pubs database.
Dim cn As New OleDbConnection(OledbPubsConnString)
page load event call bindbooklist - which in turn open DB.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Me.IsPostBack Then
BindBookList()
End If
End Sub
Sub BindBookList()
' Open a connection to Pubs, if necessary.
If cn.State = ConnectionState.Closed Then cn.Open()
...
I get the following exeception when the cn.open() is executed:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Source Error:
Line 47: Sub BindBookList()
Line 48: ' Open a connection to Pubs, if necessary.
Line 49: If cn.State = ConnectionState.Closed Then cn.Open()
Line 50:
SQL is running, i don't understand what is going on - i sense that problem lies with the account 'sa'. Please explain, what do i need to change on the account to connect successfully. Thanks in advance. Mr K.