VBA question openrecordset // runtime error 3001

Beamer

New Member
Joined
Mar 17, 2004
Messages
16
I am new to Access VBA programming and ran into some problems after I copied old code from Access 97 to my new project in acsess 2000.

I am trying to open a recordset but keep getting errors. Although this should be rather basic.

Set RIcn = CurrentDb.OpenRecordset("Tbl2_ElementInfo", dbopenDynaset)

when running my code, it gives me a runtime error 3001.

Also, when using statements like :

RIcn.NoMatch
RIcn.Edit
RIcn.FindFirst

I get errors staing : Methode or datamember not found.

It looks like I am missing an database add-in or something but not sure about this. Can someone shed a light on this. Thanks. :rolleyes:
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Access 97 uses the DAO object model by default, whereas Access 2000 uses ADO by default. You need to set a reference to Microsoft DAO 3.6 Object Library (Code window - Tools/References).
Also, you need to explicitly declare your objects as DAO...
e.g.
Dim YourVariable as Database
should become:
Dim YourVariable as DAO.Database

Dim YourVariable as Recordset
should become:
Dim YourVariable as DAO.Recordset
 
Upvote 0
Thanks, that did the job. (y)

Is there a better way to do this according to the standards of access 2000 ? I mean without loading DAO 3.6 ?
 
Upvote 0
I suppose you could convert your code to ADO, but now that you have the reference to DAO set, you shouldn't really have to do anything.
 
Upvote 0

Forum statistics

Threads
1,221,704
Messages
6,161,390
Members
451,701
Latest member
ckrings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top