OpenRecordset 97 vs 2002

M

MichaelK

In 97 I could easy open recordset any way I wanted and update it:
Dim dbs As Database
Dim rs As Recordset
Dim SQ

Set rs = CurrentDb().OpenRecordset("MyTable", dbOpenTable)
or just

Set rs = CurrentDb().OpenRecordset("MyTable")
or
SQ= "SELECT MyTable.* FROM MyTable;"
'et rs = CurrentDb().OpenRecordset(SQ)
or
Set dbs = CodeDb
Set rs = dbs.OpenRecordset("MyTable", dbOpenTable)

Since I moved to 2002 it's such a headache every time I need a recordset.

Anybody can tell me what is the best way to open table for updates in 2002.

Thanks,
Michael
 
C

Cheryl Fischer

The code is essentially the same in Access 2002 and 97. What is different
is that in Access 2002 the default library is set as a reference to ADO and
one must remember to manually set a Reference to DAO (Microsoft DAO 3.6
Object Library). In addition, unless you delete the reference to ADO, it
is recommended that you code this way:

Dim dbs as DAO.Database
Dim rs as DAO.Recordset
<etc. >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top