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!

tye mismatch for unknown reason

Status
Not open for further replies.

ghobbes98

Programmer
Feb 7, 2002
62
IE
I have created a database and when I try and connect to it I get a type mismatch error
Here is the very simple code that I am using

Private dbworkspace As Workspace
Private dbDatabase As Database
Private dbTable As Recordset
Private dbName As Field
Private dbNumber As Field

Set dbworkspace = DBEngine.Workspaces(0)
Set dbDatabase = dbworkspace.OpenDatabase
("D:\hobbes\elink\sms.mdb")
*** this is where the debugger is throwing up the error signs*****
Set dbTable = dbDatabase.OpenRecordset("Drivers", dbOpenTable)
dbTable.MoveFirst
displayfields

any ideas as to why I am getting the mismatch errors I have tried swapping the dao that I reference but to no avail
 
If you have a reference to ADO and you are using DAO, and the ADO reference is above the DAO reference in your list, then this might be causing the problem. Try declaring the Recordset as DAO.Recordset or removing the reference to ADO and see what happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top