Check your references (Tools|References). You probably have a ADO reference
instead of a DAO reference.

Signature
Paul Overway
Logico Solutions, LLC
www.logico-solutions.com
> Hi,
>
[quoted text clipped - 32 lines]
>
> Thanks.
> Iam coding data access application with database object and recordset.
> Here' s my code
[quoted text clipped - 6 lines]
> Set rs = db.OpenRecordset(sql, dbOpenDynaset) 'THE ERROR
> APPEARS HERE
[...]
> I got an error 13 at runtime that says "Type mismatch".
[...]
> Can someone tell me why I got that error at runtime.
>
> I am running
> windows xp
> visual basic 6,
> mdb file was create in Access 2003 and converted to Access97
You obviously have references to both ADO and DAO. You should disambiguate in
your typing to avoid this problem:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Note that only a recordset object is represented in both ADO and DAO but for
clarity purposes I have explicitly typed the database object also (there is no
database object in ADO).

Signature
Bruce M. Thompson, Microsoft Access MVP
bthmpson@mvps.org (See the Access FAQ at http://www.mvps.org/access)
>> NO Email Please. Keep all communications
within the newsgroups so that all might benefit.<<
JingleBEV - 30 Jun 2004 02:35 GMT
Thanks for the feedback, guy
> > Iam coding data access application with database object and recordset.
> > Here' s my code
[quoted text clipped - 31 lines]
> >> NO Email Please. Keep all communications
> within the newsgroups so that all might benefit.<<