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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Im going nuts! :) (open.recordset)

Status
Not open for further replies.

jmswe

Programmer
Feb 14, 2002
31
GB
I want to access a table in my database for some editing

I use:

Dim rst As Recordset

Set rst = CurrentDb.OpenRecordset("table1")

An get error "type mismatch".

I guess i have missed to reference some library since i seem to have to manually reference a library for every thing i want to do.

What is wrong?
 
Make sure you have set a reference to DAO (go to tools references in a module window)
If you are using Access 2000 or above, you will need to change Dim rst As Recordset to Dim rst As DAO.Recordset

The reason for this is A2k uses ADO by default instead of DAO so you need to tell it which to use.

HTH

B ----------------------------------
Ben O'Hara
bo104@westyorkshire.police.uk
----------------------------------
 
Well thats it.. :)

Im using above 2000.... but how on earth should i have figured that out? Thank god for this place and your help!!

Sane again.
 
The only reason I know it is because of forums like this! I guess I am going to have to learn at 1st hand what A2k is like. I am supposed to be upgrading to it soon. :-((

B ----------------------------------
Ben O'Hara
bo104@westyorkshire.police.uk
----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top