ChrisHiggins
Programmer
I am using VB6 to connect to an SQL server vie ADO if I use the following code I can connect.
stSQLMsg = "Select * from [purchase_interface] "
With objConn
.Provider = "SQLOLEDB"
.Properties("Data Source").Value = stSqlServer
.Properties("Initial Catalog").Value = stSqlDatabase
.Properties("User ID").Value = stSqlSignon
.Properties("Password").Value = stSqlPassword
.CursorLocation = adUseClient
.Open
End With
objRs.Open stSQLMsg, objConn, adOpenDynamic, adLockOptimistic
'Filter the records to those for processing
objRs.Filter = "[interfaced] = " & False
objRs.MoveLast
lngRecordCount = 0
lngTotalRecords = objRs.RecordCount
objRs.MoveFirst
But if I use
stSQLMsg = "Select * from [purchase_interface] Where [interfaced] = " & False
With objConn
.Provider = "SQLOLEDB"
.Properties("Data Source").Value = stSqlServer
.Properties("Initial Catalog").Value = stSqlDatabase
.Properties("User ID").Value = stSqlSignon
.Properties("Password").Value = stSqlPassword
.CursorLocation = adUseClient
.Open
End With
objRs.Open stSQLMsg, objConn, adOpenDynamic, adLockOptimistic
I get an error
What am I doing incorrect?
Thanks for any help anybody can give
Chris
stSQLMsg = "Select * from [purchase_interface] "
With objConn
.Provider = "SQLOLEDB"
.Properties("Data Source").Value = stSqlServer
.Properties("Initial Catalog").Value = stSqlDatabase
.Properties("User ID").Value = stSqlSignon
.Properties("Password").Value = stSqlPassword
.CursorLocation = adUseClient
.Open
End With
objRs.Open stSQLMsg, objConn, adOpenDynamic, adLockOptimistic
'Filter the records to those for processing
objRs.Filter = "[interfaced] = " & False
objRs.MoveLast
lngRecordCount = 0
lngTotalRecords = objRs.RecordCount
objRs.MoveFirst
But if I use
stSQLMsg = "Select * from [purchase_interface] Where [interfaced] = " & False
With objConn
.Provider = "SQLOLEDB"
.Properties("Data Source").Value = stSqlServer
.Properties("Initial Catalog").Value = stSqlDatabase
.Properties("User ID").Value = stSqlSignon
.Properties("Password").Value = stSqlPassword
.CursorLocation = adUseClient
.Open
End With
objRs.Open stSQLMsg, objConn, adOpenDynamic, adLockOptimistic
I get an error
What am I doing incorrect?
Thanks for any help anybody can give
Chris