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

Access 2003, type mismatch problem

Status
Not open for further replies.

Dmonkyking

Technical User
Apr 1, 2004
27
US
Hi,
I have some VB code in my access database that is used to backup my database. Ever since this computer was updated from Access 2002 to 2003, the code doesn't seem to work now. The line below seems to get a type mismatch when VB tries to execute it.

Set wrkDefault = DBEngine.Workspaces(0)

Does Access 2003 have a different way of setting a workspace now or am I doing somethinh wrong? Any help I can get would be greatly appreciated. Thanks.

If you need my whole code then I can paste it in. Thanks.
 
How is dimmed wrkDefault ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
oops, sorry PHV, it's defined as such:

Dim wrkDefault As Workspace
 
You may try this:
Dim wrkDefault As DAO.Workspace

Did the project compile ?
Are all the references in order ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Tried DAO.Workspace, still type mismatch error. The code does compile fine with no complaints. As far as the references being in order, I think Access 2003 did break a couple I had in there when I upgraded, but just 3rd party add-ins I added I believe. The only references I have selected right now are as follows, in order of priority:

VB for Apps
MS Access 11.0 Object Lib
MS DAO 2.5/3.0 Compat Lib
IAS Helper COM Component 1.0 Type Lib
IAS RADIUS Protocol 1.0 Type Lib
MS ADO Ext. 2.7 for DDL and Security
accoca 1.0 Type Lib

You helped me with getting this backup code to work initialy, which I appreciate immensely, but not sure why it all of a sudden is having code issues after updating MS Access. Thanks for all the past help, I really appreciate it. Hopefully you can help me out of a jam yet again :)
 
Hi there

You need to set a reference to:-

"Microsoft DAO 3.6 Object Library"

Regards

Tony
 
Haha, I figured it was something stupid. I set a reference to DAO 3.6 and it worked perfectly. Thanks Tony and PH. I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top