psasidisrcum
October 28th, 2006, 04:40 PM
Hi all,
I have SQL server express edition 2005 installed on my computer and using VB in MS Access to run some queries. The VB function looks something like this..
Dim dataRS As New ADODB.Recordset
Dim cnnSQL As New ADODB.Connection
Set cnnSQL = New ADODB.Connection
cnnSQL.ConnectionString = "Provider=SQLNCLI;Server=.\SQLExpress;Database=TestDB;Trusted_Connection=yes;"
cnnSQL.Properties("Integrated Security").Value = "SSPI"
cnnSQL.Open
dataRS.Open "SELECT dbo_Table_1.* FROM dbo_Table_1", cnnSQL, adOpenStatic, adLockOptimistic
The code fails though, on the last line with message
"Invalid object name 'dbo_Table_1'"
(yes, I verified that the table actually does exist in the DB)
I must be doing something wrong with the connection string but all the things that I've tried so far haven't worked.. Can anyone offer any suggestions?
Thanks in advance,
I have SQL server express edition 2005 installed on my computer and using VB in MS Access to run some queries. The VB function looks something like this..
Dim dataRS As New ADODB.Recordset
Dim cnnSQL As New ADODB.Connection
Set cnnSQL = New ADODB.Connection
cnnSQL.ConnectionString = "Provider=SQLNCLI;Server=.\SQLExpress;Database=TestDB;Trusted_Connection=yes;"
cnnSQL.Properties("Integrated Security").Value = "SSPI"
cnnSQL.Open
dataRS.Open "SELECT dbo_Table_1.* FROM dbo_Table_1", cnnSQL, adOpenStatic, adLockOptimistic
The code fails though, on the last line with message
"Invalid object name 'dbo_Table_1'"
(yes, I verified that the table actually does exist in the DB)
I must be doing something wrong with the connection string but all the things that I've tried so far haven't worked.. Can anyone offer any suggestions?
Thanks in advance,