Link to home
Start Free TrialLog in
Avatar of dfohr
dfohr

asked on

Error on DBEngine.Workspaces(0)

I have an Access database that is used locally by about 150 different people, on different computers and versions of windows and office.

I need to create an access database. In order to do this, I use the following code:

Dim wsp As Workspace
Dim dbs As Database
Set wsp = DBEngine.Workspaces(0)
Set dbs = wsp.CreateDatabase(Application.CurrentProject.Path & "\Newdb.mdb", dbLangGeneral & ";pwd=xxxx", dbEncrypt)

On a very small number of machines, I am getting an error, exactly on the line

Set wsp = DBEngine.Workspaces(0)

You can't debug a Set statement, but I know by inserting MsgBox statements before and after the statement. The error occurs exactly on that line.

I basically just get a "Halt" window. No interesting information in the error message.

The only constant is that the people with this error have Win2K and OfficeXP, although there are many users with this same configuration that have no problems.
Avatar of nico5038
nico5038
Flag of Netherlands image

Did you check the references on those machines?
Just go into VBA (e.g. by opening a module) and select Tools/References.
The library list shouldn't contain a reference name starting with MISSING.
If found, uncheck and (e.g. incase of DAO) replace the library with the same name and another version.
However unchecking is often enough.

Nic;o)

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial