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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

project or library not found 1

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
0
0
US
I installed a db app yesterday and it worked fine on one machine but not on the other. The one that worked was win98 and the one that didn't was win2000. I got a message that said "project or library not found" on a dim db as dbs statement.

I was told:
Open a VB module in design mode. Select Tools | References. Makes sure a Microsoft DAO 3.X Object Library is selected.

Does this mean to open a new module set the reference and then save? If this is the case, will the module execute automatically when the db is open?

Thanks..Russ


 
Russ. Click on the Modules tab then New or Design, it does not matter which. Click on tools then References. In the dialog box you should have a tick against Microsoft DAO 3.X Object Library. If it does not then tick it and click OK. Close the module. Access will save the references and all should be well the next time you open the database.


David
 
David,

Will this work for both the 98 and 2000 machines? The app is on a network?

Thanks..Russ
 
Hi Russ!
this should work but there is one thing!! in your first thread you only said wich version of windows you have!! However, what DJN told you to do is only if the MS-Office version is different! However, judging by the error it gave you, if you do what DJN told you to do, the problem will be fixed! in the older version of MS-Office you don't need to change a thing! after you change the references you will probably have to change the next sentence:

dim db as dbs

to

dim db as dao.dbs

Hope it helps!
Skep... :)
 
here is code you can put in module that you can run on startup so you never have to worry about it again:

faq181-936
 
The references will be lost if you swap from a win98 machine to a win2000 machine, because on a win98 machine the ocx files are stored (generally) in c:\windows\system. However, on a windows 2000 machine they will be stored in c:\winnt\system32. You will therefore get this error each time you switch machine.

A solution to this is to use the developer tools & create a deployment package. This should then scan the database for dependencies, & bundle the relevant ocx files with your custom installation app. When you install the database on the host computer, the default installation path for the ocx files is (WinSysPath). They will therefore be installed in the correct folder, & the references should be automatically linked correctly.

Skeptic is also correct about changing any ambiguous declarations to a format compatible with Access 2000/2. Even if you are not using Access 2000 or later, it is generally a good practice to do this, because when it comes to updating the database you will not have to go through modifiying all of your code... James Goodman
 
If you are running the database from a network location, & users share this database (i.e. they all use one database, rather than having one back-end db, & each user having a front-end db.

If the former is the case, & users will be using either Win98 or Win2000, ocx referencing could become problematic. When you reinstall the reference files, their path is stored, so that when the db is opened the next time, they can automatically be re-referenced. However, if the next user is using a different operating system the path will have changed (see above post). It will therefore pop exactly the same message again.

There are three solutions to this, but I think only one will work efficiently.

The first & best method is to create a seperate front-end, which will be installed on each machine. The db containing the tables is stored on the network location, & the front-end db's link to them. By using this method, & installing the database properly (front-end) each user should never get a 'project or library not found'. This will also handle multiple users much more efficiently.

The second is to use something like the Environ function to test where the OS is installed. Based upon the value this returns, you can then manually set the paths to the ocx files. You can use the IsMissing function to test whether or not a reference is missing. However, after much frustration I have found that if a missing reference is found, it is apparently impossible to remove this reference in code.

The third is to try installing the ocx files on the network share, & MAKING sure the db references these ocx files, not those on your system. I think this will then work irrespective of user-OS, but I am not completely sure... James Goodman
 
Thanks for all the good advice. When I added a module and referenced the 2.5/3.0 library. The 98 machine worked but the 2000 box said the file was missing. Where do I get the ocx from?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top