Call stored query with ADO

steve728

Registered User.
Local time
Today, 10:30
Joined
Mar 4, 2003
Messages
16
Help!

I'm converting my code from DAO to ADO. With DAO
I simply call my stored query with:

Dim db1 as database, rs as recordset
set db1 = currentdb
set rs = db1.OpenRecordset("Stored Query")

How do I do it with ADO? Please show me the code
syntax.

Thank you!

Steve
:confused:
 
Steve,

There are quite a few ways, which creates confusion. A couple of examples.

Code:
'read-only
Dim rst as New ADODB.Recordset
rst.Open "QueryName", CurrentProject.Connection
and
Code:
'to change data
Dim rst as New ADODB.Recordset
rst.Open "QueryName", CurrentProject.Connection, adOpenDynamic, adLockOptimistic

Regards,
Tim
 
Thank you!

Thank you so much. This is a great help to me!

Steve
 

Users who are viewing this thread

Back
Top Bottom