Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile error: can't find project or library...?

Status
Not open for further replies.

dblake

Programmer
Jul 27, 1999
9
0
0
ZA
I started working on Access and programmed the normal way, making the following declaration:<br>
<br>
Dim Rst as Database<br>
<br>
Further on I have a statement:<br>
Me!txtTime = Date<br>
<br>
When I compile the module, both lines result in the error:<br>
Compile error: can't find project or library<br>
<br>
And when I click OK, it brings up "available references" with a list of DLL's and OCX's etc.<br>
<br>
Which ones are the correct DLL's for the Database object, and the Date function (or does the problem lie with the Access' setup) ?<br>
(I found that the Now function works, but would like to know the answer for Date in any case!)
 
Make sure that "Microsoft DAO 3.51 Object Library" is one of the references selected. I think it is a file name dao350.dll which is usually found in c:\program files\common files\microsoft shared\dao.
 
What a coincidence! I just had this problem the other day.<br>
<br>
In my case, I had been developing a DB on my workstation and everything was OK. When I ran it on another desktop I got the "reference" error.<br>
<br>
The problem was that I was using a non-standard OCX that had been installed on my desktop only.<br>
The problem with the Access reference error is that it points you in the wrong direction. In my case it flagged the Date function when in fact the problem had nothing to do with date (I was also using DB objects so I went down the DAO path as well).<br>
<br>
Check your references and make sure that all the selected ones are available - verify that the DLL/OCX is indeed accessible. If necessary, install the missing reference via the add-in manager, third party install, or simple copy.<br>
<br>
Good luck!<br>

 
I've run into the same issue. Furthermore, after getting the error &quot;Compile error: can't find project or library&quot; when running a simple VB statement: [Cdate]=date, I've found that I can't even check my REFERENCES menu because it's grayed out. The only way to get it back it to REPAIR the database.

Even more, I am running other databases on the same machine that work fine, using the same VB statements.

Any ideas?
 
Solved my own problem!

The issue that there are MISSING refrences in the TOOL/REFERENCES list. Problem is that once you run the form and get the error, the REFERENCES is grayed out of the TOOLS menu.

So close and reopen the form in DESIGN MODE and then look at your code again... then REFERENCES should be highlighted now.... look for any items checked that show as MISSING and uncheck them. This should solve the error message, however if what you are missing is nessessary to your code, you will have to copy it over (as stated above by FooDog).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top