Can't locate project or library

G

Guest

Hi,

I'm attempting to run code using Access 2000 on Windows XP OS

My code stops at the following lines:

Dim rs as recordset
Dim as database

I received the error "Can't locate project or library"

I've selected the following libraries:

Visual Basic for Applications
Mircorsoft Access 10.0 Object Library
OLE Automation
Microsoft ata Access Componenets Installed ersion
Microsoft ActiveX Data Objects 2.0 Library
Microsoft ActiveX Plugin

Please help.

I cant even troubleshoot my code because I can't get past the DIM statements

Thanks
 
P

Paul Overway

You need a reference to DAO...and probably can do without the reference to
ADO. I'd also question some of the other references you have selected...and
remove them if they're not needed.
 
G

Guest

Hi Paul,

I deselected ADO and selected DAO. I still get the same error. Also, I
probably should have mentioned that my tables are located in SQL Server. Is
DAO still okay to use?

This is my code...it's pretty simple:

Dim eduid As Integer
Dim rst As Recordset - (the program stops here and if I comment this out it
stops at the next DIM statement)
Dim db As Database

Set eduid = [Forms]![FrmEducatorInformationMain]![EDUCATOR_ID].Value
Set db = CurrentDb
Set rst = db.OpenRecordset("dbo_MEDS_LRC_INSTRUCTORS")

With rst
..AddNew
ACCOUNTNO_CONTCT_ID = eduid
EDUCATOR_ID = eduid
..Update
End With


Thanks
Elyse
 
P

Paul Overway

You might have a problem with DAO...or another reference. Try calling this
function:

Function DAO_OK() As Boolean

Dim varDBE As Variant

On Error Resume Next

If Access.Application.SysCmd(acSysCmdAccessVer) = "8.0" Then
Set varDBE = VBA.CreateObject("DAO.DBEngine.35")
Else
Set varDBE = VBA.CreateObject("DAO.DBEngine.36")
End If

DAO_OK = (Err.Number = 0)

End Function

If you get false, something is wrong with your DAO install...please see
articles 296205, 319841, or 319844 in Microsoft's Knowledge Base at
support.microsoft.com.

If it returns true, make sure none of your references indicates MISSING.

Using DAO with SQL Server is ok if you're using linked tables. In any case,
you're getting a compile error, so, you haven't even opened a recordset yet.



--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


elyse said:
Hi Paul,

I deselected ADO and selected DAO. I still get the same error. Also, I
probably should have mentioned that my tables are located in SQL Server.
Is
DAO still okay to use?

This is my code...it's pretty simple:

Dim eduid As Integer
Dim rst As Recordset - (the program stops here and if I comment this out
it
stops at the next DIM statement)
Dim db As Database

Set eduid = [Forms]![FrmEducatorInformationMain]![EDUCATOR_ID].Value
Set db = CurrentDb
Set rst = db.OpenRecordset("dbo_MEDS_LRC_INSTRUCTORS")

With rst
.AddNew
ACCOUNTNO_CONTCT_ID = eduid
EDUCATOR_ID = eduid
.Update
End With


Thanks
Elyse

Paul Overway said:
You need a reference to DAO...and probably can do without the reference
to
ADO. I'd also question some of the other references you have
selected...and
remove them if they're not needed.
 
G

Guest

Thanks Paul,

I had a reference with the word MISSING next to it. I simple deselected it
and everything is working great.

Thanks again
Elyse

Paul Overway said:
You might have a problem with DAO...or another reference. Try calling this
function:

Function DAO_OK() As Boolean

Dim varDBE As Variant

On Error Resume Next

If Access.Application.SysCmd(acSysCmdAccessVer) = "8.0" Then
Set varDBE = VBA.CreateObject("DAO.DBEngine.35")
Else
Set varDBE = VBA.CreateObject("DAO.DBEngine.36")
End If

DAO_OK = (Err.Number = 0)

End Function

If you get false, something is wrong with your DAO install...please see
articles 296205, 319841, or 319844 in Microsoft's Knowledge Base at
support.microsoft.com.

If it returns true, make sure none of your references indicates MISSING.

Using DAO with SQL Server is ok if you're using linked tables. In any case,
you're getting a compile error, so, you haven't even opened a recordset yet.



--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


elyse said:
Hi Paul,

I deselected ADO and selected DAO. I still get the same error. Also, I
probably should have mentioned that my tables are located in SQL Server.
Is
DAO still okay to use?

This is my code...it's pretty simple:

Dim eduid As Integer
Dim rst As Recordset - (the program stops here and if I comment this out
it
stops at the next DIM statement)
Dim db As Database

Set eduid = [Forms]![FrmEducatorInformationMain]![EDUCATOR_ID].Value
Set db = CurrentDb
Set rst = db.OpenRecordset("dbo_MEDS_LRC_INSTRUCTORS")

With rst
.AddNew
ACCOUNTNO_CONTCT_ID = eduid
EDUCATOR_ID = eduid
.Update
End With


Thanks
Elyse

Paul Overway said:
You need a reference to DAO...and probably can do without the reference
to
ADO. I'd also question some of the other references you have
selected...and
remove them if they're not needed.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


Hi,

I'm attempting to run code using Access 2000 on Windows XP OS

My code stops at the following lines:

Dim rs as recordset
Dim as database

I received the error "Can't locate project or library"

I've selected the following libraries:

Visual Basic for Applications
Mircorsoft Access 10.0 Object Library
OLE Automation
Microsoft ata Access Componenets Installed ersion
Microsoft ActiveX Data Objects 2.0 Library
Microsoft ActiveX Plugin

Please help.

I cant even troubleshoot my code because I can't get past the DIM
statements

Thanks
 

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