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

Modifying a secured DB table from another database

Status
Not open for further replies.

grogery

Programmer
Aug 14, 2001
7
0
0
ZA
How do you set a DB variable to an open Database
that has its own workgroup file without getting any errors?


For example:

If 'C:\Temp\Temp.mdb' is a secured DB and has its
own workgroup file called 'C:\Temp\WKS_Temp.mdw' -
is it possible to maybe pass the Workgroup filename
with a username and password when you set a reference
to the database?

eg:
Dim DB As Database

Set DB = OpenDatabase("C:\tmp\Temp.mdb /wrkgrp " & _
C:\tmp\WKS_Temp.mdw", , , "UID=Read;PWD=me")

Debug.Print DB.TableDefs.Count

Set DB = Nothing

* This does not work!
Can someone please help!!!???!!!
 
OpenDatabase takes a path name. The /wrkgrp and other switches are only acceptable as part of the command line passed from Windows (or possibly as part of a profile). This method won't work.

I did a search for other DAO properties that could help. What I learned is that the system database is associated with the DBEngine object, and is specified by its SystemDB property. You can only change this property before you start to use the Jet engine. I don't think that's gonna work for you.

But here's a workaround that I know will work. You can duplicate the user account in the workgroup you're already attached to. As long as the user account name and PID are identical, it doesn't matter to Access or Jet where the account comes from.

Once you have a duplicate user account in your workgroup, you need to do a CreateWorkspace, which allows you to be simultaneously logged on with the user/password for the secured database. Then, in that workspace, you do OpenDatabase to actually access it.

I've been trying to think if duplicating the user account in an insecure workgroup file would compromise security in any way. I'll think some more and post later (I need to go out now). Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top