Link to home
Start Free TrialLog in
Avatar of IUAATech
IUAATech

asked on

Run Time error 13

I see quite a few posts out there asking about "Run Time error 13", but I haven't found anything helpful so far.

Here is my scenario: My predecessor was running some VB code using Office 2003 (Microsoft Access) on a Windows 2000 server. Now, we just upgraded to Server 2008 and I am using Office 2007. When I try to run the following code, I get a "Run Time error 13 Type mismatch" error. I haven't been able to find a solution to my problem yet.

Please refer to the attached code. The OpenRecordset for tblNCLOutput works just fine. But, when I try to do a OpenRecordset on tblIndividualsAndDegrees, I get a Run Rime error 13. What gives?

And I can confirm that the table exists in the Access database.
Dim dbCur As Database
    Dim rstNCLIndividualsAndDegrees As Recordset
    Dim rstNCL As Recordset
 
    Set dbCur = CurrentDb()
    Set rstNCLOutputTable = dbCur.OpenRecordset("tblNCLOutput", dbOpenDynaset)
    Set rstNCLIndividualsAndDegrees = dbCur.OpenRecordset("tblIndividualsAndDegrees", dbReadOnly)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IUAATech
IUAATech

ASKER

Thanks. You are a life saver.

It looks like I will need to update the code throughout the app and append "DAO."
to explain the issue:
both ADO and DAO have a recordset class.
if both are active in the project references, vb will silently pick 1 from them (without warning).

so, good practice is to always prefix your classes from project they are coming from.

glad I could help