I am making my application ready for backending to SQL Server using ODBC.
How do I do 'Set rs = ..." without using db.OpenRecordset.
I need to loop through a table picking specific records.
Hi Chrissie1
Because we are not sure, we will be allowed to keep our SQL Server and are trying to make our code capable of returning to the Access environment if necessary, without a code rewrite.
Cheers
Hans
Using 'Set rs = Db.OpenRecordset' accesses the data depending on the CurrentProject.Connection whether tables are linked using ODBC or OLEDB.
So:
Dim rs As RecordSet
Set rs = Db.OpenRecordset("SELECT tblMine.* FROM tblMine;"
would create an ADO (default from Access 2000 on) recordset using the CurrentProject.Connection shown below. In this case it uses OLEDB. The connection is merely a function of the linking.
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.