Microsoft KB Archive/927678

= Error message when you convert a database file from an earlier version of Access into an Access 2007 file: &quot;Run-time error '13': Type mismatch&quot; =

Article ID: 927678

Article Last Modified on 10/15/2007

-

APPLIES TO


 * Microsoft Office Access 2007

-



SYMPTOMS
When you convert a database file from an earlier version of Microsoft Access into a Microsoft Office Access 2007 file, the application may stop responding if you try to run or compile code that uses Data Access Objects (DAO). Additionally, you may receive the following error message:

Run-time error ‘13’:

Type mismatch



CAUSE
This problem occurs because the order of database references is not preserved when the database file is converted.



WORKAROUND
To work around this problem, use one of the following methods:

Method 1
In the References dialog box, make sure that Microsoft Office 2007 Access database engine Object Library is higher in priority than Microsoft ActiveX Data Objects. To do this, follow these steps:
 * 1) Start Access 2007.
 * 2) Click the Microsoft Office Button, and then click Open.
 * 3) In the Open dialog box, locate and select , and then click Open.
 * 4) On the Database Tools menu, click Visual Basic in the Macro group to open Visual Basic Editor (VBE).

Note You may also press ALT+F11 to open VBE.
 * 1) On the Tools menu, click References.
 * 2) In the References -   dialog box, click Microsoft Office 2007 Access database engine Object Library.
 * 3) Click the Priority arrow to move Microsoft Office 2007 Access database engine Object Library above Microsoft ActiveX Data Objects, and then click OK.

Method 2
If you must reference and use both DAO and ActiveX Data Objects (ADO) object libraries, dimension the objects explicitly as follows: Dim adoRS As ADODB.Recordset Dim daoRS As DAO.Recordset

Method 3
If you are not using an ADO object library, clear the reference to the library. To do this, follow these steps:  Start Access 2007. Click the Microsoft Office Button, and then click Open. In the Open dialog box, locate and select, and then click Open. On the Database Tools menu, click Visual Basic in the Macro group to open VBE.

Note You may also press ALT+F11 to open VBE.

 On the Tools menu, click References. In the References -  dialog box, click to clear Microsoft ActiveX Data Objects, and then click OK.</ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Additional query words: AC2007 ACC2007

Keywords: kberrmsg kbtshoot kbprb kbexpertiseinter KB927678

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.