Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to connect to the server via sConnString

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
The below code is showing an error: : '[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.'

This is the code:
'Set connection to the database
Dim oOleDbConnection As OleDbConnection = Nothing 'Create db connection
Dim objCmd As OleDbCommand = Nothing
Dim sConnString As String, strSQL As String, strSQLSelect As String

'Connection string for database
sConnString = "Provider=SQLOLEDB;Data Server=RICKNDELLM2800\SQLEXPRESS;Database=ExactMAXSAM;User ID=sa;password=job1!boss;"
oOleDbConnection = New OleDbConnection(sConnString)
oOleDbConnection.ConnectionString = sConnString
oOleDbConnection.Open()

frmimport.Show() 'to display subform

oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top