question about Workspaces(0).OpenDatabase

R

rocio

I never developed and used Acess in the past, now I have to decode a program written in VB4 that accesses an Access db. I installed the program in a computer running windows server 2000 only (this is, ther is no Office programs installed), and when I try running the code it crashes with the message "File not Found", then another error message thta I can track from the src code of this application.

It seems to crash when trying to load the main form of the app, Form_Load() . The statements here are:

' open the assessment number and name database
Set dbPhotobase = Workspaces(0).OpenDatabase(GetDatabasePath & "mydbase.mdb")
Set rsPhotoval = dbPhotobase.OpenRecordset("photoval", dbOpenDynaset)
Set rsImages = dbPhotobase.OpenRecordset("images", dbOpenDynaset)

' create the images directory if it does not exist
On Error Resume Next
MkDir Left$(GetImagePath, Len(GetImagePath) - 1)

' this is static
usrCurrentImage.strPath = GetImagePath
Exit Sub
err_Form_Load:
' unload the program if the database is not accessible
MsgBox "Could not start Photobase: " & Err.Description, vbCritical, APP_TITLE
End

the error message I get (that comes from the err_Form section above) is:
Could not start Photobase: object required

my guess is, since I do not have Microsoft Office installed in this computer, maybe I'm missing some Access objects that will enable Workspaces to open this database? Or, do I need to have Access install in order to run this piece of code?

Hope you can help on this one.....
 

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