Microsoft KB Archive/282331

= You receive a &quot;Compile Error: Can't Find Project or Library&quot; error message when you run a procedure that references Jet and the Replication Objects library =

Article ID: 282331

Article Last Modified on 8/11/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q282331



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you run a procedure that references an object from the Microsoft Jet and Replication Objects (JRO) 2.5 Library, you may receive the following error message:

Microsoft Visual Basic

Compile error:

Can't find project or library.

In addition, the computer that you are running the procedure on displays a reference to the Microsoft Jet and Replication Objects 2.6 Library. However, the computer that the procedure was developed on actually had a reference to version 2.5.



CAUSE
The procedure was created on a computer that has Microsoft Data Access Components (MDAC) version 2.6 installed, and you are running it on computer that has MDAC version 2.5 installed.



RESOLUTION
To resolve this issue, on the computer that has MDAC 2.5 installed, click to clear the Microsoft Jet and Replication Objects 2.6 Library check box, and then add a reference to the Microsoft Jet and Replication Objects 2.5 Library. To do so, follow these steps:  Open the Visual Basic Environment (VBE). On the Tools menu, click References. At this point, you receive the following error message:

Your Microsoft Access Database or project contains a missing or broken reference to the file 'msjro.dll' version 2.6.

 Click OK. Click to clear the item in the References list that appears as, &quot;MISSING: Microsoft Jet and Replication Objects 2.6 Library.&quot; Click OK.</li> On the Tools menu, click References.</li> In the list of available references, click to select the Microsoft Jet and Replication Objects 2.5 Library check box, and then click OK.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce the Behavior
<ol> On a computer that has MDAC 2.6 installed, create a new database. These steps will refer to this computer as the source computer.

NOTE: To ensure that MDAC 2.6 is installed, run the MDAC Component Checker. This downloadable tool is available from the following Microsoft Web site:

http://msdn.microsoft.com/dataaccess

</li> Create a new module.</li> On the Tools menu, click References. Scroll through the list until you locate the Microsoft Jet and Replication Objects 2.5 Library. Click to select this library, and then click OK.</li>  Add the following code to the new module: Sub MDACTest Dim repCurrentApp as New jro.replica End Sub </li> Save and then close the module.</li> Save and then close the database on the source computer.</li> Copy the database to a computer that has MDAC 2.5 installed. These steps will refer to this computer as the target computer.</li> On the target computer, open the database, and then run the procedure. Note that you receive the error message that was mentioned earlier in this article.</li> On the target computer, stop execution of the procedure. On the Tools menu, click References. Note that the Microsoft Jet and Replication Objects Library is designated as MISSING. In addition, note that the version number on the target computer is version 2.6 when the version number referenced on the source computer was actually version 2.5.</li></ol>

Additional query words: pra jro mdac procedure compile error can't find project or library

Keywords: kberrmsg kbtshoot kbbug kbnofix kbprogramming KB282331

-

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

© Microsoft Corporation. All rights reserved.