97 Code provokes error in 2000

J

John F Kappler

Hi! Me again......

The following statement (working quite happily in Access 97):

Set MySet = MyDB.OpenRecordset(TSql)
or for that matter...:
Set MySet = MyDB.OpenRecordset("Stock Sales")

Provokes the error message:

13 Type mismatch

Given how much help HELP is, can anyone give me a clue as to what is
going on?

TIA

JohnK
 
J

John F Kappler

Spot on. I almost feel like living again!!

Thanks,

JohnK

p.s. Sorry to have posted so many questions, but these issues always
seem to come up when we're under our most pressure and need to resolve
yesterday.

Hi John,
Hi! Me again......

This one I think I know the answer to said:
The following statement (working quite happily in Access 97):

Set MySet = MyDB.OpenRecordset(TSql)
or for that matter...:
Set MySet = MyDB.OpenRecordset("Stock Sales")

Provokes the error message:

13 Type mismatch

Given how much help HELP is, can anyone give me a clue as to what is
going on?

At a guess, the reference to the DAO library comes after the reference
to Activex Data Objects (ADO) in the Tools|References dialog. This means
that
Dim MyDB as Database
declares a DAO.Database (because there's no such thing as
ADODB.Database), while
Dim MySet as Recordset
declares an ADODB.Recordset.

Either remove the reference to ADO, or (a good idea anyway) qualify your
declarations:
Dim MyDB As DAO.Database
Dim MySet As DAO.Recordset


John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
J

John Nurick

Glad to help. For your other questions, which are beyond my experience
(I managed to avoid Access 2000), there might be something at
http://www.granite.ab.ca/access/performancefaq.htm if you haven't alread
looked there.

Spot on. I almost feel like living again!!

Thanks,

JohnK

p.s. Sorry to have posted so many questions, but these issues always
seem to come up when we're under our most pressure and need to resolve
yesterday.

Hi John,
Hi! Me again......

This one I think I know the answer to said:
The following statement (working quite happily in Access 97):

Set MySet = MyDB.OpenRecordset(TSql)
or for that matter...:
Set MySet = MyDB.OpenRecordset("Stock Sales")

Provokes the error message:

13 Type mismatch

Given how much help HELP is, can anyone give me a clue as to what is
going on?

At a guess, the reference to the DAO library comes after the reference
to Activex Data Objects (ADO) in the Tools|References dialog. This means
that
Dim MyDB as Database
declares a DAO.Database (because there's no such thing as
ADODB.Database), while
Dim MySet as Recordset
declares an ADODB.Recordset.

Either remove the reference to ADO, or (a good idea anyway) qualify your
declarations:
Dim MyDB As DAO.Database
Dim MySet As DAO.Recordset


John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 

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