Using CurrentDB() receives Type Mismatch Error 13 
Author Message
 Using CurrentDB() receives Type Mismatch Error 13

On a Access 2K, Win 98 machine, I can't run any database
or application object specific functions.

The Date() and Time() functions work from the immediate
windows but basic ones like CurrentDB() will not.

Spec's:
Access 2K SR-1
Win 98 Secon Edition
MDAC 2.6 installed.

I've tried various DAO refernces but they all give me the
same error.

Any ideas?

John



Tue, 03 Aug 2004 01:11:16 GMT  
 Using CurrentDB() receives Type Mismatch Error 13
Well, there's only one DAO reference you should be using with Access 2000 or
greater, and that's DAO 3.6, so if you've changed that, first change it
back.

When you've done that, if you're still having problems, try showing an
example of the code you're using. For example, in the Immediate window, ?
currentdb will always return a type mismatch error. That's normal and to be
expected, because currentdb returns an object, and you can't print an
object. But if ? currentdb.name returns an error, then you have a problem.

--
Brendan Reynolds
Access MVP

Sample Access 2000/2002 app at
http://brenreyn.brinkster.net
----------------------------------------
If it's not plain text, without attachments,
I'm not reading it.
----------------------------------------

Quote:
> On a Access 2K, Win 98 machine, I can't run any database
> or application object specific functions.

> The Date() and Time() functions work from the immediate
> windows but basic ones like CurrentDB() will not.

> Spec's:
> Access 2K SR-1
> Win 98 Secon Edition
> MDAC 2.6 installed.

> I've tried various DAO refernces but they all give me the
> same error.

> Any ideas?

> John



Tue, 03 Aug 2004 04:49:41 GMT  
 Using CurrentDB() receives Type Mismatch Error 13
The problem is probably that you need a reference to DAO 3.6

Quoting Van T. Dinh

A2K and AXP default to ADO which does not have a Database Object.  Database
is an Object of DAO which A97 defaults to.  To use your code, you should:

*  Add the DAO 3.6 Object Library into the References Collection of your
Database.

* Move DAO in the References Dialog so that it has higher Priority than ADO.

* Better still, remove ADO from the References if you are not using it (if
you don't know it, you are not using it).

* For sturdy code, you should disambiguate Recordset in your Dim statement
like

    Dim dst As DAO.Recordset

This is the 2nd problem in your post: your dst defaulted to ADO's Recordset
but you need DAO's Recordset.

There are some other Objects you should do the same (Field, Property, etc
...)

END quote

(thanks Tony Toews for the FAQ DB)

Quote:

> On a Access 2K, Win 98 machine, I can't run any database
> or application object specific functions.

> The Date() and Time() functions work from the immediate
> windows but basic ones like CurrentDB() will not.

> Spec's:
> Access 2K SR-1
> Win 98 Secon Edition
> MDAC 2.6 installed.

> I've tried various DAO refernces but they all give me the
> same error.

> Any ideas?

> John



Tue, 03 Aug 2004 05:29:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Worked fine yesterday, today I get Error 13 Type Mismatch errors

2. Error 13: Type Mismatch error

3. Type Mismatch Run-Time error 13

4. Type Mismatch Error 13

5. type mismatch error '13'????

6. Type mismatch, run-time error #13

7. type 13 mismatch error

8. ACC2000:Run Time Error '13': Type Mismatch

9. Invalid Reference (Error 13 - Type Mismatch)

10. Run -time error '13' Type Mismatch

11. Run-time error '13': Type mismatch

 

 
Powered by phpBB® Forum Software