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:
If you start a form that specifically uses the reference, you may receive the following error message:
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 "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
- Save the form as StartupForm.
- On the Tools menu, click Startup.
- In the Display Form/Page combo box, click to select StartupForm, and then click OK.
- Change the default ADO reference to reference the version of ADO that is installed in step 1. To do this, follow these steps:
- Press ALT+F11 to open the Visual Basic Environment (VBE).
- On the Tools menu, click References.
- 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.
- 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.
- Deploy and install the newly created package to a computer with a clean installation of Microsoft Windows 98.
- Run the application. Notice that you receive the first error message that is described in the "Symptoms" section.
- Click OK to move past the error message.
- 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