Hello,
I have an application which uses a SQL server 2003 Back end and an
Access 2003 front end.
I am trying to populate a recordset in the FE with data from an ODBC
linked table to the BE. Here is my code:
dim dbs as database, rstList as DAO.RecordSet, sqlString as string
set dbs = currentDB
sqlString = "Select field1, field2 FROM table WHERE field1 = 12345"
set rstList = dbs.openrecordset(sqlString, dbOpenDynaset)
I get an error which says "Runtime Error 4146 - ODBC Call failed". This
works fine if I use an Access BE.
I assume that the problem is to do with the DAO.recordset bit, and that
I'm not connecting correctly to the SQL server BE. Do I need to use a
connection string? Surely I've already connected to SQL when I opened
by application, so I don't understand why it should be a problem. Any
suggestions??
Thanks in advance
Colin