Workspaces Collection (1 Viewer)

mikec

Registered User.
Local time
Today, 10:33
Joined
Dec 17, 1999
Messages
22
Hello,

I'm working with a user-level secured database and am attempting to use a second workspace which will give me more access than the actual user who logs in.

I am able to create the workspace and add it to the workspaces collection, but I can't seem to reference it correctly:

Global TempSpace as Workspace
Set TempSpace = CreateWorkspace("TempWorkSpace", "GenUser", Enter, dbUseJet) 'GenUser is the User and Enter is a variable which equates to a hidden password
DbEngine.Workspaces.Append TempSpace

The above works, if I print the count of workspaces, I get 2.

My problem is when I try to set a Database variable to the Workspace:
Dim DB as Database
Set DB = DBEngine.Workspaces(TempSpace).Databases(0)

I get a Data type conversion error on the Set DB line.

Any help would be greatly appreciated.

Thanks,

Mike
 

Users who are viewing this thread

Top Bottom