error 13

  • Thread starter Thread starter Douglas J. Steele
  • Start date Start date
D

Douglas J. Steele

Since you don't say, I have to guess.

You're using Access 2000 or newer. You added a reference to DAO (or else the
first statement "Dim wsp As workspace, db As DAO.Database, rst As Recordset"
would have raised an error about "user-type not found), but you didn't
remove the reference to ADO.

If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rst as DAO.Recordset (to guarantee an ADO recordset, you'd use Dim
rst As ADODB.Recordset)

The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset
 
Hi all,

I use the following piece of code, which gives me the
error 13 (types don't match).
I sometimes have this error, but what can be the cause of
it, I do not see anything incorrect ?

Dim wsp As workspace, db As DAO.Database, rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("ImportTable")

Can anyone help ?

Thank you very much,

Wim
 
Douglas,

And right you are. It all had to do with references.
Thank you very much. By the way where can I find
documentation about ADO ?

Wim
-----Original Message-----
Since you don't say, I have to guess.

You're using Access 2000 or newer. You added a reference to DAO (or else the
first statement "Dim wsp As workspace, db As
DAO.Database, rst As Recordset"
 
Back
Top