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

Article translations Article translations
Article ID: 282331 - View products that this article applies to.
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).

Expand all | Collapse all

On This Page

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:
  1. Open the Visual Basic Environment (VBE).
  2. On the Tools menu, click References.
  3. 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.
  4. Click OK.
  5. Click to clear the item in the References list that appears as, "MISSING: Microsoft Jet and Replication Objects 2.6 Library."
  6. Click OK.
  7. On the Tools menu, click References.
  8. In the list of available references, click to select the Microsoft Jet and Replication Objects 2.5 Library check box, and then click OK.

STATUS

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

MORE INFORMATION

Steps to Reproduce the Behavior

  1. 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/en-us/data/aa937729.aspx
  2. Create a new module.
  3. 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.
  4. Add the following code to the new module:
    Sub MDACTest()
    Dim repCurrentApp as New jro.replica
    End Sub
    					
  5. Save and then close the module.
  6. Save and then close the database on the source computer.
  7. Copy the database to a computer that has MDAC 2.5 installed. These steps will refer to this computer as the target computer.
  8. 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.
  9. 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.

Properties

Article ID: 282331 - Last Review: August 11, 2004 - Revision: 4.2
APPLIES TO
  • Microsoft Access 2002 Standard Edition
Keywords: 
kbprogramming kbtshoot kbbug kberrmsg kbnofix KB282331

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com