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

I am working with Access2000 after

Status
Not open for further replies.

jwalz

Programmer
Oct 31, 2000
78
US
I am working with Access2000 after many years with 97. And for some stupid reason am struggling with writing a simple piece of code to pull the contents of a table into a recordset so that I can process them. Please, please can someone help me? When trying to execute the OpenRecordset method I get an error: Run-time error '13': Type mismatch. This is driving me crazy. Here is my code:
Sub main()

Dim UDdb As Database
Dim Dset As Recordset
Dim dwgStr As String

Set UDdb = CurrentDb()
Set Dset = UDdb.OpenRecordset("UpdateDrawings")
....
UpdateDrawings is the name of a table in the current database.
Thanks!
Janet
 
Hi Janet!

A2K uses ADO as the default object library. You need to go into your code window and choose Tool/Referencs. Scroll down in the list box until you find a reference to MS DAO (Data Access Objects) 3.6 and mark the check box beside it. After you close the dialog box you will need to change you code to:

Dim UDdb As DAO.Database
Dim Dset As DAO.Recordset

Alternatively you can use the arrow keys beside the list box to move the reference to DAO up until it is above the reference to ADO and it will then be the default object library. I prefer to make the code specific.

hth


Jeff Bridgham
bridgham@purdue.edu
 
Jeff,

That did the trick. Thank you very much.

Janet
 
but you may still want to get some reference material on Ms. A. 2K and review ADO. Acording to many, it is 'the future', although there are still a lot of issues which MS would need to resolve before removing DAO.





MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top