Acess error: "Compile Error: Canot find Project or Library"

J

John Morgan

I have sent on a split Access 2002 format database successfully to a
person on a regular basis for some years. The two files are mdb files,
one more or less a user interface and the other containing the data.

On the last occasion that I have sent on the database the receiver
reports that when using the user interface he uses a search screen and
gets a message "Compile Error: Canot find Project or Library".

I cannot repeat this error on either of my own two machines and the
user is many miles away so I am unable to visit. From a distance I
have tried all that I can think of without success and I would be most
grateful if someone could help me..

For your info the user interface contains modules as well as queries
and forms.


If on my own machine I open the references from a module window then
the following are ticked:


Visual Basic for Applications
Microsoft Access 10.0 object library
OLE Automation
Microsoft ActiveX Data Objects 2.1 library
Microsoft Outlook 12.0 object library


I have asked the receiver to check that the above are ticked on his
machine and he claims that they are. He also says that nothing has
changed on his computer since the previous version was successfully
used. I

Any help or advice would be most gratefully received,

Best wishes, John M
 
J

John Morgan

Canot find Project or Library


The recipient has now told me - after two weeks !- he is running
Vista, and this appears to be achange f rom last year, whereas the
database was designed on Windows XP.

Does this lead to the answer to my main query? I am not accustomed to
Vista,

Best wishes, John M.
 
S

Stefan Hoffmann

hi John,

John said:
The recipient has now told me - after two weeks !- he is running
Vista, and this appears to be achange f rom last year, whereas the
database was designed on Windows XP.
Vista is normally not the problem. He should touch (uncheck/check) the
references.

Maybe:

http://allenbrowne.com/ser-38.html


mfG
--> stefan <--
 
J

John Morgan

hi John,


Vista is normally not the problem. He should touch (uncheck/check) the
references.

Maybe:

http://allenbrowne.com/ser-38.html


mfG
--> stefan <--


Thanks for your comments and for ther website reference which I found
very useful..
Two further points:

1. Checking the references in the database I sent on I see that I
have checked in my list both Microsoft Access 10.0 object library and
Microsoft Outlook 12.0 object library.

I am wondering whether Access 2002 supports Microsoft Outlook 12.0
object, if not could this be the sourece of the problem if the
recipient does not have a later version of Access on his machine?

2. The library components seem to have a n address on the user machine
which appear to be somewhere around c:windows\system32\
Could there be a d ifferent address in Vista for these files?

Advice gratefully received,

Best wishes, John M.
 
S

Stefan Hoffmann

hi John,

John said:
1. Checking the references in the database I sent on I see that I
have checked in my list both Microsoft Access 10.0 object library and
Microsoft Outlook 12.0 object library.
Office 12 is Office 2007. In conjunction with Access 10, this indicates
that you use Office 10, but have installed either one other Office
application or you have installed the Office 2007 compatibility pack
(for reading .docx etc.).
2. The library components seem to have a n address on the user machine
which appear to be somewhere around c:windows\system32\
Could there be a d ifferent address in Vista for these files?
The path doesn't count for a registered library.

One thing worth trying: Create a new empty .mdb and import all objects.
Maybe your file is corrupted.


mfG
--> stefan <--
 
T

Tony Toews [MVP]

John Morgan said:
I have asked the receiver to check that the above are ticked on his
machine and he claims that they are.

Sub ViewReferenceDetails()

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & "
- " & ref.FullPath
Next ref

End Sub

for a more human readable version add a reference to "MS VBA
Extensibility 5.3"

Then you can use the description property:

Dim ref As VBIDE.Reference

For Each ref In Access.Application.VBE.ActiveVBProject.References
Debug.Print ref.Description
Next

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

John Morgan said:
1. Checking the references in the database I sent on I see that I
have checked in my list both Microsoft Access 10.0 object library and
Microsoft Outlook 12.0 object library.

What version of Outlook does he have? If he has a different version
that will be the problem. He would need to uncheck yours and find
his version. This assumes you are giving him the FE as an MDB.

I would also suggest you consider using late binding. Late binding
means you can safely remove the reference and only have an error when
the app executes lines of code in question. Rather than erroring out
while starting up the app and not allowing the users in the app at
all. Or when hitting a mid, left or trim function call.

This also is very useful when you don't know version of the external
application will reside on the target system. Or if your organization
is in the middle of moving from one version to another.

For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page at
http://www.granite.ab.ca/access/latebinding.htm
I am wondering whether Access 2002 supports Microsoft Outlook 12.0
object,

Yes, it should be just fine. Although if you used a feature present
in Outlook 12/2007 and he is running Outlook 11/2003 which doesn't
have that feature then yes, that could be a problem.
2. The library components seem to have a n address on the user machine
which appear to be somewhere around c:windows\system32\
Could there be a d ifferent address in Vista for these files?

I'm not sure what you mean here.

Tony

--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
J

John Morgan

Sub ViewReferenceDetails()

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & "
- " & ref.FullPath
Next ref

End Sub

for a more human readable version add a reference to "MS VBA
Extensibility 5.3"

Then you can use the description property:

Dim ref As VBIDE.Reference

For Each ref In Access.Application.VBE.ActiveVBProject.References
Debug.Print ref.Description
Next

Tony

Thank you Tony for this post and previous post, I do value your help
and will look into it further on the lines you suggest,

Best wishes, John Morgan
 
J

John Morgan

Sub ViewReferenceDetails()

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & "
- " & ref.FullPath
Next ref

End Sub

for a more human readable version add a reference to "MS VBA
Extensibility 5.3"

Then you can use the description property:

Dim ref As VBIDE.Reference

For Each ref In Access.Application.VBE.ActiveVBProject.References
Debug.Print ref.Description
Next

Tony


Thanks for the assistance. Problem is now solved. The error was
caused by a reference to a Microsoft Outlook 12.0 object library on my
own machines whereas the other distant machine is running an earlier
version Microsoft Outlook 11.0 object library.

Though , as I said , the application had run smoothly for years with
only reconfiguration of some data. It appears that using Access 2002
on my computer, the original refernce to Microsoft Outlook 11.0
object libray seems to have been automatically updated to the 12.0
version when I installed Office 2007.

Would have helped if the recipient had properly followed my fault
identification procedure sent on,

Thanks again, John M.
 
T

Tony Toews [MVP]

John Morgan said:
Would have helped if the recipient had properly followed my fault
identification procedure sent on,

Never expect anyone to follow directions. Which is one reason to use
late binding mentioned in a previous posting.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top