I am working with a newly converted to Access 2000 database. Now, no matter which table I try to open (OpenRecordSet) I get a run-time error '13' Type mismatch for no apparent reason. It worked before!
Thanks,
casox
Printable View
I am working with a newly converted to Access 2000 database. Now, no matter which table I try to open (OpenRecordSet) I get a run-time error '13' Type mismatch for no apparent reason. It worked before!
Thanks,
casox
Didya change your references to use the right version of DAO? or MDAC?
I know what this is caused by, but I don't know the solution, myself.
Here's the code that will raise the error:
Upon either of the Set commands w/OpenRecordset method the 2000 db will return a type mismatch.Code:
Public Sub CheckVers()
Dim PatchVers As Recordset
Dim CurrentVers As Recordset
Dim db As Database
Set db = CurrentDb
Set PatchVers = db.OpenRecordset("tblVersionNumber")
Set CurrentVers = db.OpenRecordset("tblCurrentVersion")
I've checked DAO 3.60 referencing, and still get the error.
I found out the problem . . .
I had ADO 2.1 checked also, and it was first on my references list.
Hello, I have the same problem as Casox. Where I'm trying to connect to a Access 2000 database with my OpenRecordset. I have the lastest server pack for VB and MDAC. I also have checked DAO 3.60 referencing and still got the error. JohnAtWork said: "I had ADO 2.1 checked also, and it was first on my references list." but I can't find it in the list.
If anyone can help me, I would be grateful.
Thanks,
Husky
I found the problem. You have to clear the reference to Microsoft ActiveX Data Objects.
Thanks,
Husky
I needed the ActiveX components, but after removing the reference, and putting it back again, it worked fine.
No more Type Mismatch.
Strange thing though. Using a data control to connect to the db worked fine, only now when I used code only, did the error come up.
What gives?
Anyhow, thanks for the solution.
To avoid confusion, if you are using both ADO and DAO, use prefixes ADODB and DAO before the object types, for e.g. ADODB.Recordset and DAO.Recordset. This will clarify the code and also avoid such errors.
.