Complier error: Can't find project or library

hwl

New member
Local time
Today, 11:50
Joined
Jun 19, 2009
Messages
3
hi all,

Here is my current setup:

- o/s: fresh install of Win2k SP4
- Access 97 SR2
- database is an Orcale db sitting on a server
- ODBC driver(verion 2.5.3.1.0B from Orcale) is used for connection to the database

Here is the problem:

I am getting a " Compile error: Can't find project or library" for the 'str' function. I got this when I launch my .mdb from the file explorer. The code launches a "startup" form which calls the 'UserData' function for user validation

The "MyRole" is a link table(ie. a Orcale table on a server)

Below is section of code:

***** start of code ******

=================
LabModule1:Module
==================

option explicit
public intUsrIdNum as Integer
...
...


=================
function UserData
=================

dim rstUserRole as recordset

set db = CurrentDb()

set rstUserRole = db.OpenRecordset("MY_Role",dbOpenDynaset)
...
...
...


With rstUserRole
.FindFirst strCriteria
if .NoMatch then

MsgBox "No Entry found for user" & str(intUserIdNum), vbOKOly, "Error"

else

...
...

end if

end with
...
...

end UserData

****** end of code ******

Access complains about the 'str' function which I believe is a built-in function. Any pointer would be appreciated.

Please help.

Cheers
 
The built-in functions are only built in if Access knows where to find them, so you seem to be missing a reference.

Open your database, then open any module.
Go to Tools -> References.

In my Access 97 I seem to have a default of three references ticked at the top. These are (in order):
Visual Basic For Applications
Microsoft Access 8.0 Object Library
Microsoft DAO 3.51 Object Library

If any of these are not showing, or are showing but have the word MISSING after them, then some of your built-in functions will be missing. Also, if one is missing it can stop Access using the others correctly, so even if the one containing "str" is present (not sure which one this is by the way), if one of theothers is missing then this will be interfering with your use of "str".

If you are missing one you'll need to look down the list and see if it's there but unticked (below the ticked ones they are in alphabetical order). If it's not there at all you'll have to browse for it. Post which one is missing and I'll post the path I have for it, which may be the same for you if it's just in a standard folder.
 
Kafrin,

thanks for the pointer. It was a missing reference for FM20.DLL. I went to MS website and found the activex app which contains the required dll.

thanks you very much.

Cheers,
 
I wouldn't have used the str function in this case. Cstr would have done well and it doesn't require a reference to be set ( I would avoid having references set if not necessary - especially to the Forms 2.0 stuff).
 
sos,

thanks for the pointer. I will keep that in mind.

Cheers,
 

Users who are viewing this thread

Back
Top Bottom