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?
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.
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.
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
Microsoft Development
Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.
ASKER
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