Tech Support Guy banner
Status
Not open for further replies.
1 - 4 of 4 Posts

·
Registered
Joined
·
3 Posts
Discussion Starter · #1 ·
Private Sub Form_Load()

Dim db As database
Dim rs As Recordset

Set db = CurrentDb
Set rs = db.openrecordset("sm")

Debug.Print "Record count is : " & rs.RecordCount

End Sub

*********** I use the above code to open a table and display the no. of records. But I get an error message in access 2000. Run time error 13, "type mismatch" and dubugging halts on "Set rs = db.openrecordset("sm")" line.

What is wrong ? Can someone help ?? Please !

One more thing - As in vb6 do I have to set something like Project->References etc. in Access 2000 also for statements like "dim db as database" to work. If yes, where ?

Thanks in advance.
 

·
Registered
Joined
·
1 Posts
You can go to the microsoft page support.microsoft.com/kb/q181542/ for your answer.

If you have both an ADO and DAO Reference the order in which they appear is important or you will receive this error.
 
1 - 4 of 4 Posts
Status
Not open for further replies.
Top