Microsoft Knowledge Base Email Alertz

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

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 927678 - Last Review: October 15, 2007 - Revision: 1.3

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

On This Page

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 <DatabaseName>, 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.
  5. On the Tools menu, click References.
  6. In the References - <DatabaseName> dialog box, click Microsoft Office 2007 Access database engine Object Library.
  7. 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:
  1. Start Access 2007.
  2. Click the Microsoft Office Button, and then click Open.
  3. In the Open dialog box, locate and select <DatabaseName>, and then click Open.
  4. 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.
  5. On the Tools menu, click References.
  6. In the References - <DatabaseName> dialog box, click to clear Microsoft ActiveX Data Objects, and then click OK.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

APPLIES TO
  • Microsoft Office Access 2007
Keywords: 
kberrmsg kbtshoot kbprb kbexpertiseinter KB927678
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate