• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3363
  • Last Modified:

Open Password Protected Access Database via Command Line or Batch File

Description pretty much says it all.. Here's what I am trying.. While it opens up the database the login dialog box still appears..
"C:\Program Files (x86)\Microsoft Office 2003\OFFICE11\MSACCESS.EXE" /pwd PASSWORD /user USERNAME /wrkgrp "\\QARCdb\users\database\QARC.mdw" "C:\Data\Max\Live\QARC2003.mde"

Open in new window

0
kpurchase
Asked:
kpurchase
  • 4
  • 4
  • 4
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
try this:

"C:\Program Files (x86)\Microsoft Office 2003\OFFICE11\MSACCESS.EXE" /pwd="PASSWORD" /user= "USERNAME" /wrkgrp "\\QARCdb\users\database\QARC.mdw" "C:\Data\Max\Live\QARC2003.mde"

mx
0
 
kpurchaseAuthor Commented:
That makes

="USERNAME"

appear in the Name: text box of the logon dialog box interestingly enough.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Well ... this is an example I have that came from a Q here at some point.

Open with User Name and Password with Workgroup

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /wrkgrp \\cotserver\vol1\departments\fire\databases\cityfire.mdw "\\cotserver\vol1\departments\fire\databases\cityfire personnel.mdb" /user="jammer" /pwd="pass"

Also, see these links:

http://support.microsoft.com/kb/209207

http://www.vb123.com/workbench/help/commandline.htm

http://office.microsoft.com/en-us/access/HP051883001033.aspx
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
If this is a database protected ONLY by a database password, then you cannot use a commandline parameter to do this.

if this is secured by ULS, then you can use the command line parameters as mx suggests.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I was assuming ULS since the original post showed

/wrkgrp "\\QARCdb\users\database\QARC.mdw" "C:\Data\Max\Live\QARC2003.mde"

 ^^^^^^^

mx
0
 
kpurchaseAuthor Commented:
Hey guys it is not a database password but a password protected database with an associated (and required) mdw.. And using the code stated above gives me the same result where no password is placed into the password logon box and the username box has "=Brandon" (including the quotes). So I am not sure what I am doing wrong.. Here is what I am using now...

"C:\Program Files\Microsoft Office 2003\OFFICE11\MSACCESS.EXE" /wrkgrp "\\QARCdb\users\database\QARC.mdw" "C:\Data\Max\Live\QARC2003.mdb" /user="Brandon" /pwd="123"
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You don't use the "=" with these parameters; do this:

"C:\Program Files\Microsoft Office 2003\OFFICE11\MSACCESS.EXE" /wrkgrp "\\QARCdb\users\database\QARC.mdw" "C:\Data\Max\Live\QARC2003.mdb" /user "Brandon" /pwd "123"

You also have your arguments in the wrong order. Should be:

"C:\Program Files\Microsoft Office 2003\OFFICE11\MSACCESS.EXE" "C:\Data\Max\Live\QARC2003.mdb" /wrkgrp "\\QARCdb\users\database\QARC.mdw" /user "Brandon" /pwd "123"
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Also: You were presented with the login box since Access couldn't find a user name "=Brandon" ... if the Brandon user exists with a password of "123", then you won't see the login box.
0
 
kpurchaseAuthor Commented:
That gets the username correctly entered but leaves the password entry blank still..
0
 
kpurchaseAuthor Commented:
Tried it with a different username and password and it worked perfectly... thanks.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"You don't use the "=" with these parameters; "

Scott ... I realized that example I posted was something you posted quite some time ago (I'm pretty sure). It had "=Scott" ... which I changed to "jammer"

mx
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
That doesn't surprise me <g> ....

If you're still getting the password prompt, then it would seem the Password you're passing in is incorrect.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 4
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now