How to open a secured mdb from another database (1 Viewer)

SmallTime

Registered User.
Local time
Today, 09:01
Joined
Mar 24, 2011
Messages
246
I’m using a secured 2K mdb as a backend and 2010 (accdb) as frontend and have a problem in that the FE doesn't recognise DoCmd.RunCommand acCmdUserAndGroupAccounts so users can’t change\reset their passwords or add new users to the workgroup.

I thought about giving users another shortcut to access the backend where DoCmd.RunCommand acCmdUserAndGroupAccounts works fine but would like a ‘reasonably’ seamless way of doing this from the front instead. Had a look at using ‘ShellExecute’ but it seems this doesn’t allow for switches.

So does anyone know how I would go about running the following from code?

"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "C:\TEST\MYBE.mdb" /User "MYNAME" /wrkgrp "C:\TEST\SECURED.mdw"

SmallTime
 

DJkarl

Registered User.
Local time
Today, 11:01
Joined
Mar 16, 2007
Messages
1,028
You do know that workgourp and ULS went away with the accdb format, Access has the compatibility to use it so long as the database format is 2003 or earlier. Unless you downgrade your front-end to 2003 I'm not sure you can open the back-end through the front-end.

As for creating a shortcut this might be useful.

http://www.vb123.com/toolshed/05_access/workgroupfiles_shortcuts.htm
 

SmallTime

Registered User.
Local time
Today, 09:01
Joined
Mar 24, 2011
Messages
246
Hi DJkarl,

Yes your right in 2010 accdb no longer uses workgroup security and that's why I've left the BE in 2K format. It works pretty well. However to change passwords or to add new users I have to log onto the BE. So, rather then dropping a new shortcut on users desktops I was hoping to somehow run the above including the switches from the from the FE.

Regards
SmallTime
 

vbaInet

AWF VIP
Local time
Today, 17:01
Joined
Jan 22, 2010
Messages
26,374
SmallTime, what I think is happening is your FE is in 2010 and doesn't support security. You are running the command from a version of Access that doesn't support this feature.

So what should you do? Connect to the BE with an Access Object and use that object to call the command. I haven't tried it but here's the logic:
Code:
dim xlApp as object

set xlApp = createobject("access.application")

xlApp.opencurrentdatabase "path\to\be"

xlApp.DoCmd.RunCommand CmdUserAndGroupAccounts

set xlApp = nothing
Or

You could try creating a blank Access 2003 db that uses the same System.mdw file used by the BE, using the aircode above, open this database and run the command.
 

SmallTime

Registered User.
Local time
Today, 09:01
Joined
Mar 24, 2011
Messages
246
Thanks

Yes the FE (2010 accdb) doesn't support the feature. However, because it's connected to the 2000 (mdb) BE which does support the User Level Security I noted that, so long as the CurrentUser 'Admin' is blocked (If CurrentUser = "Admin" docmd.Quit") then users are still required when logging into the FE to using the old log-on screen and MDW file which is called from the shorcut (/wrkgrp "C:\TEST\SECURED.mdw"). For me ,this seems a reasonable workaround for the time being until I can get some time to making my own security and amending the numerous places where I've used CurrentUser() to automatically fill in new record fields. It's just that at this time I can't get around to for a month or two.

I'll try your suggestion later on today once I've got the kids to bed and see if it works, otherwise I fear I have no choice other than a separate shortcut to the BE. Oh well.

Anyway, thank you ever so much for your time and advice, I know it's a little tricky opening one database from another in the manner in was hoping for.

Kindest regards
Amjad
 

vbaInet

AWF VIP
Local time
Today, 17:01
Joined
Jan 22, 2010
Messages
26,374
Keep us updated. Unfortunately I don't have Access 2003 handy to test it out.

I've just gotten round to reading your first post again and noted the last line about running that command. You can use Shell with the /k or /h or /c switch. I don't remember which one.
 

Users who are viewing this thread

Top Bottom