Microsoft KB Archive/317388

From BetaArchive Wiki

Article ID: 317388

Article Last Modified on 2/12/2007



APPLIES TO

  • Microsoft Office XP Developer Edition



This article was previously published under Q317388

SYMPTOMS

After you deploy a Microsoft Access 2002 runtime application that references the Microsoft ActiveX Data Objects library (Msado15.dll), the following error is generated:

Your database or project contains a missing or broken reference to the file Msado15.dll version <version number>. To make sure that your database or project works correctly, you must fix this reference.

To learn how to fix this reference, click Help.

If you start a form that specifically uses the reference, you may receive the following error message:

Execution of this application has stopped due to a runtime error.

'The application cannot continue and will be shut down.'

CAUSE

The application is referencing a newer version of ActiveX Data Objects (ADO) than the one that is installed on the deployment computer.

RESOLUTION

To resolve this issue, use one of the following methods:

Method 1

Install a newer version of the Microsoft Data Access Components (MDAC) on the deployment computer. The newer version must match the version of ADO that you are referencing. MDAC includes the file Msado15.dll and updates the file accordingly. To download the latest version of MDAC, visit the following Microsoft Web site:

Welcome to the Universal Data Access Web Site http://msdn.microsoft.com/dataaccess


Method 2

Change the ADO reference in your application to match the version on the deployment computer.

MORE INFORMATION

When you include the System Files with your Access Runtime deployment package, this only installs MDAC 2.5, the version that was included with Office XP.

Steps to Reproduce the Behavior

  1. Install MDAC 2.6 or later on your Office XP development computer.
  2. Create a new Access 2002 database.
  3. In the Database window, click Forms under Objects, and then click New.
  4. In the New Form dialog box, click to select Design View, and then click OK.
  5. Add a command button to the newly created form.
  6. Put the following code on the OnClick event of the button.

    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    
    rs.Open "Select FirstName, LastName from Employees where LastName = 'Davolio'", _
    CurrentProject.Connection, adOpenDynamic, adLockOptimistic
    
    MsgBox "First Name:" & rs.Fields(0) & "  Last name:" & rs.Fields(1)
    
    rs.Close
    Set rs = nothing
                        
  7. Save the form as StartupForm.
  8. On the Tools menu, click Startup.
  9. In the Display Form/Page combo box, click to select StartupForm, and then click OK.
  10. Change the default ADO reference to reference the version of ADO that is installed in step 1. To do this, follow these steps:
    1. Press ALT+F11 to open the Visual Basic Environment (VBE).
    2. On the Tools menu, click References.
    3. Clear the reference to the Microsoft ActiveX Data Objects 2.1 Library (ADO), add a reference to the latest version of ADO available on your computer (2.6 or later), and then click OK.
  11. Create a deployment package by using the Office XP Developer Packaging Wizard. Make sure that you select the option to include the Access Runtime and the System Files during the process.
  12. Deploy and install the newly created package to a computer with a clean installation of Microsoft Windows 98.
  13. Run the application. Notice that you receive the first error message that is described in the "Symptoms" section.
  14. Click OK to move past the error message.
  15. Click Command on the form that you created in step 3. Notice that you receive the second error message that is described in the "Symptoms" section.


REFERENCES

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

304007 How to avoid common mistakes when you create distributable run-time applications



Additional query words: acc2002 modXP

Keywords: kbprb KB317388