If I do not want to use a DSN to connect to a database - what do I use. I am using the below for a connection and getting prompted ODBC error.
Will this work:
Dim oRS As ADODB.Recordset
Dim oConn As ADODB.Connection
Dim oCmd As ADODB.Command
Dim strSQL As String
Set oConn = New ADODB.Connection
oConn.Open "Provider=sqloledb;" & _
"Server=sql901;" & _
"Database=EmpLibrary;" & _
"User Id=SQLViewUser;" & _
"Password=SQLViewUser"
'On Error GoTo 0
If oConn.State <> adStateOpen Then Exit Sub
Set oRS = New ADODB.Recordset
Will this work:
Dim oRS As ADODB.Recordset
Dim oConn As ADODB.Connection
Dim oCmd As ADODB.Command
Dim strSQL As String
Set oConn = New ADODB.Connection
oConn.Open "Provider=sqloledb;" & _
"Server=sql901;" & _
"Database=EmpLibrary;" & _
"User Id=SQLViewUser;" & _
"Password=SQLViewUser"
'On Error GoTo 0
If oConn.State <> adStateOpen Then Exit Sub
Set oRS = New ADODB.Recordset