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()
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()