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

Running Access2000 database in XP

Status
Not open for further replies.

Aerowolf

Programmer
Nov 6, 2002
64
I created a database in Access2000 that I have been using in Windows 2000. The database exists on a network drive and I access it through a shortcut on my desktop. I am switching to a brand new computer with XP Professional on it.

I've installed Office2000 on this new computer. I've copied the shortcut to the new computer and everything was working great until I tried to click on a button the has the following code attached to it:

Private Sub ProdReport_Click()
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists("P:\Edwin\Production.snp") = True Then
fs.deletefile "P:\Edwin\Production.snp"
End If
DoCmd.RunMacro "ProdReport"
End Sub

When I click on the button that starts this code, I get the following error:

Compile error: can't find project or library.

I've also noticed that I can't create data pages by using the wizard because I get the following error when I try:

ActiveX component can't create object.

What's going on? I'm guessing something is not installed on the new computer that I need.

Help!!!!!

Edwin
 
Try this:

Open the visual basic editor from access (doesn't matter what code is in there).

Click Tools/References... wait for the pop-up window

Find the library you need (probably Microsoft DAO 3.6 object library)

Check it's check box, click ok and you should be good to go



jimlad
 
You might need a reference to the Microsoft Scripting Runtime (Tools, References from a VBA-editing window...

Alternatively, try using the Kill command instead, i.e.
Code:
Private Sub ProdReport_Click()
On Error GoTo Err_ProdReport_Click
Kill ("P:\Edwin\Production.snp")
DoCmd.RunMacro "ProdReport"

Exit_ProdReport_Click:
    Exit Function

Err_ProdReport_Click:
    Select Case Err.Number
    Case 53 ' File not found
        Resume Next ' So carry on
    Case Else
        MsgBox Err.Number & ": " & Err.Description, vbCritical
        Resume Exit_ProdReport_Click
    End Select

End Sub

[pc2]
 
OK...the reference to the Scripting Runtime doesn't make a difference. When I try the reference to the DAO, I get the error, "Error in loading DLL".

Now what?

Thanks for all the help guys!

Edwin
 
Hmm not really sure about the DAO ref then, that's kinka the extent of my knowledge of this. You could try unchecking any old references (eg: Microsoft DAO 3.5) as it may be trying to access these first (if they are higher up on the list)?? not sure really, let me know if it works

jimlad
 
Well I figured it out.
The new computer did not have a couple things installed that the old computer did. The references were pointing to these items, but on the new computer, the references showed up as MISSING. When I unchecked these items on the new computer, everything was fine. The application runs just fine on both machines now.

Thanks for all the help!

Edwin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top