STRANGE BEHAVIOR OF A "DAO" RECORDSET

M

mff.jhw

I am beginning to develope applications with Access 2000. Now I'm trying to
run a piece of code in Access Visual Basic like this:



DIM BD AS DATABASE

DIM RS AS RECORDSET

DIM QUER AS STRING



SET BD = CURRENTDB()

QUER = "SELECT C1, C2, ..., C12 FROM MYTABLE WHERE ... ;"

SET RS = BD.OPENRECORDSET(QUER, DBOPENSNAPSHOT)

....



(The table of this example, MYTABLE, is local in the Access database)



When I run it, I get the following runtime error in the OPENRECORDSET
statement:



- Error 13: "TYPES DO NOT MATCH" or "TYPE CONFLICT" (in spanish the message
is "NO COINCIDEN LOS TIPOS")



I can't understand what this means because I have checked the DIM lines one
and another time and everything seems to be correct.



Could anybody tell me what is happening, please?
 
K

Ken Snell

ACCESS 2000 uses ADO library by default, not the DAO library.

Open Visual Basic Editor, click on Tools | References, and select the DAO
library. If you don't wish to use ADO library, unselect it. Close the
window.

If you didn't unselect ADO library, you will need to use DAO. in front of
the references to the DAO objects, because DAO and ADO share some object
names.

Dim rs As DAO.Recordset

etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top