Link to home
Start Free TrialLog in
Avatar of Bob Collison
Bob CollisonFlag for Canada

asked on

Type Mismatch Error 13 after conversion to Access 20010 from 2003

Hi Experts,
I have just converted a 2003 Access application to 2010 and when I began testing encountered Type Mismatch Error 13 in the following code between Message Test 3 and Message Test 4.
Dim DB_020 As Database
MsgBox "Test 1"
Dim RS_00_EMAIL_EXPORT_DATA_020 As Recordset
MsgBox "Test 2"
Set DB_020 = CurrentDb
MsgBox "Test 3"
Set RS_00_EMAIL_EXPORT_DATA_020 = DB_020.OpenRecordset("00_EMAIL_EXPORT_DATA, dbOpenTable")
MsgBox "Test 4"

Has the required code changed and if so can you suggest what it should be?

I am also attaching a file containing the VBA References from the 2003 version and the converted 2010 version.  Are there any that are missing / incorrect?

Thanks.
Bob Collison
EE-Question-VBA-References.docx
SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada 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
SOLUTION
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 Bob Collison

ASKER

Hi Experts,
Thanks to both of you for the information.

However I'm not sure whether I just need both ADO and DOA References / code as I don't know what the difference / reason is for each of them.

I also am not sure what the References are for each of these.

Could you possibly explain / advise?

Thanks.
Bob Collison
SOLUTION
Avatar of Nick67
Nick67
Flag of Canada 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
SOLUTION
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
SOLUTION
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
SOLUTION
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
SOLUTION
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
SOLUTION
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
Hi Experts,
Thanks for the explanation.

Can you advise which References are applicable to DAO and ADO (in those I am using) so that I can try each way as you suggest?

It appears that my best bet as a 'standard' is ADO. Does this make sense?

Thanks.
Bob Collison.
SOLUTION
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
SOLUTION
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
Hi Experts,

I have changed the code to the following with the References for Access 2010 as per my attachment and it works correctly with the following code.
Dim DB_020 As Database
MsgBox "Test 1"
Dim RS_00_EMAIL_EXPORT_DATA_020 As DAO.Recordset
MsgBox "Test 2"
Set DB_020 = CurrentDb
MsgBox "Test 3"
Set RS_00_EMAIL_EXPORT_DATA_020 = DB_020.OpenRecordset("00_EMAIL_EXPORT_DATA")
MsgBox "Test 4"

I still would like to know what Reference provides the DAO / ADO functions.

Thanks.
SOLUTION
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
SOLUTION
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
SOLUTION
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
Hi Experts,

I have the following code referencing ADO like this so I can't Just remove the ADO Reference.  I believe that this is the only ADO Statement in my Application although it is used many times for different Tables.
Dim RS_21_ORGANIZATION_MSTR_100 As New ADODB.Recordset

I tried replacing ADO with DAO in the statement and it doesn't work.

What is the equivalent DAO statement?

Thanks.
Bob Collison
SOLUTION
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
SOLUTION
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
SOLUTION
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
ASKER CERTIFIED SOLUTION
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
Hi Expert,

Thanks for your link to the syntax.  I'll have to do some reading and testing.

Unfortunately I have to go out soon so I won't be back to you probably for a couple of days.

Thanks again for everything so far.
Bob Collison
SOLUTION
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
SOLUTION
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
SOLUTION
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
Hi Experts,
I have completed testing of a small Application with the code you have suggested which is all DAO as I don't have any connections to the Web or via ODBC.

With regard to the References.  During conversion from 2003 to 2010 it appears that the Microsoft DAO 3.5 Object (DAO) Library was de-selected leaving just the Microsoft ActiveX Data Objects (ADO) 2.5 Library.  To facilitate my using the DAO Option only I deselected the ADO and selected the DAO references.  Everything appears to work correctly.

Thanks for your patience and assistance.
Bob Collison