Microsoft KB Archive/317388

= OFFXPDEV: Missing ADO Reference Errors When Deploying an Access 2002 Runtime Application =

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. 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
 Install MDAC 2.6 or later on your Office XP development computer. Create a new Access 2002 database. In the Database window, click Forms under Objects, and then click New. In the New Form dialog box, click to select Design View, and then click OK. Add a command button to the newly created form.  Put the following code on the OnClick event of the button. Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset

rs.Open &quot;Select FirstName, LastName from Employees where LastName = 'Davolio'&quot;, _ CurrentProject.Connection, adOpenDynamic, adLockOptimistic

MsgBox &quot;First Name:&quot; & rs.Fields(0) & &quot; Last name:&quot; & rs.Fields(1)

rs.Close Set rs = nothing </li> Save the form as StartupForm.</li> On the Tools menu, click Startup.</li> In the Display Form/Page combo box, click to select StartupForm, and then click OK.</li> Change the default ADO reference to reference the version of ADO that is installed in step 1. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Press ALT+F11 to open the Visual Basic Environment (VBE).</li> On the Tools menu, click References.</li> 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.</li></ol> </li> 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.</li> Deploy and install the newly created package to a computer with a clean installation of Microsoft Windows 98.</li> Run the application. Notice that you receive the first error message that is described in the &quot;Symptoms&quot; section.</li> Click OK to move past the error message.</li> Click Command on the form that you created in step 3. Notice that you receive the second error message that is described in the &quot;Symptoms&quot; section.</li></ol>

<div class="references_section">