CurrentDB problem..

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Hi anyone,
Here what I have for you:

1 Dim db As Database
2 Dim rs As Recordset
3 Dim strSQL As String

4 strSQL = "SELECT * FROM tbl_Orders"
5 Set db = CurrentDb
6 Set rs = db.OpenRecordset(strSQL)

At line 6 it says: "Type Mismatch.." code 13.
All compiles fine, I have DAO 3.6 checked.

What is the problem?

P.S. it seems to me it does not even sees the CurrenDB..

Thanks for you help, Wizards.
 
Hi,
If you also have ADO as a reference, you have be clear on which library
you want the recordset to come from.

Dim rs As DAO.Recordset

should fix it. (or remove the ADO reference)
 
Thanks for your help, Dan.
Though I didn't have ADO as reference, I guess it took it
by default. Thanks again.
 
Back
Top