Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi guys this is getting a litle

Status
Not open for further replies.

rookery

Programmer
Apr 4, 2002
384
GB
Hi guys

this is getting a litle frustrating but am I right in saying that Access2K doesn't support the "Database" variable? If not can I use the "Object" variable in its place? If this is the case, why cant I use the OpenRecordset method in the code below:

Set MyRS = dbs.OpenRecordset("DiaryNotes", dbOpendynaset)

I am getting a 3001 "Invalid Argument" error. It worked fine in an Access 97 app.

Someone please put me out of my misery!!
 
Hi there

could you check the libraries reference
(found under tools, references in the modules)

You need the DAO 3.6 object Library above
the activex object library

The following code worked Ok just copy it into a module and check for your self


Dim dbs As Database
Set dbs = CurrentDb()
Dim myrs As Recordset
Set myrs = dbs.OpenRecordset("DiaryNotes", DB_OPEN_DYNASET)

myrs.MoveFirst

myrs.Close
Set dbs = Nothing

See if this helps

regards

Jo
 
Jo you are a diamond! It works a treat. Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top