Click to See Complete Forum and Search --> : Recordset Object


yaronb
April 25th, 2001, 03:03 AM
I am using the Recordset object in Access 2000, but it seems that there are a few different definitions of it, and so I get a "type mismatch" error on the following code:

Dim db as Database
Dim rc as Recordset
set db=CurrentDB
set rc=db.OpenRecordset("mytable")




I think it's because of the References table I am using ("Visual Basic for Applications", "Microsoft Access 9.0 Object Library" and more).
How do I force the "Dim rc as Recordset" statement to define my variable as the same Recordset that Database.OpenRecordset is returning ?

Thanks,
Yaron.

Iouri
April 25th, 2001, 07:23 AM
That might happen if you use ADO recordset and referencing to the DAO object Database. Make shure that either you are using ADO or DAO. In case you are using both of them you have to use prefix like

Dim db as DAO.Database
or
Dim rc as ADODB.Recordset

Iouri Boutchkine
iouri@hotsheet.com