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!

Batch file open .mdb with workgroup log in 1

Status
Not open for further replies.

EITech

Programmer
Oct 15, 2000
13
0
0
US
I'm trying to set up a batch file to open an .mdb. This would run unattended during the night. So far I have:
START "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Folder\RevSchedules.mdb" /wrkgrp "L:\ITStuff\Workgroup.mdw" /user GoodUser /pwd MagicWord
This doesn't work because we have a security account log-in password that requires the user to log in to the workgroup, before opening Access at all. It's not the same as a database password. The following line, typed in to the Start-Run command line, does open the db without prompting for the log-in, but I can't figure out how to automate it:
MSACCESS.exe C:\Folder\RevSchedules.mdb /User GoodUser /Pwd SecretWord
I have found an article in the MSKB that describes the problem, but doesn't say anything can be done about it! Does anyone know how to set this up in the command line?
Thanks!
 
I'm not familiar with how you have Access protected from running... but some things to try:

I noticed that the password is different in your two examples... If those are the actual passwords, try using the same one you used in the run line in the batch file... Be sure to change the password too :)

Beyond that, you are using double quotes in the batchfile for long filenames and not at the run prompt... try using the old 8.3 name for the file/path in the batch file.

One other trick that comes to mind is to create an additional workgroup file (PID's etc have to be the same). Use that workgroup to bypass the other if it is network permissions giving you fit. Note that you should be paranoid about where you place this file as it is the PID's not the paswords that protect the database.
 
Hi, thanks for your response. It wasn't any of those things, but your response inspired me to experiment some more. I finally took the START off the beginning of the command line in the batch file, and it worked fine! (I had previously removed the wrkgrp and user switches, and just left the Access path, the file path, and the pwd switch.) Whew, I've been stuck on this for 3 days.
 
I've been stuck with this same problem. My plan is to have a batch file execute automatically every Friday. I'm planning to use the Scheduled Task app in Windows to schedule the batch file to be run weekly. The batch file is supposed to open up MS Access, open up my database (using the correct login and password), and run my macro (which sends out a report via email and closes MS Access). My only problem is that I can't get Access to open up using a specified user and password. Here are the contents of my batch file:

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
"path_to_my_dB\MyDB.mdb"
/wrkgrp "path_to_workgroup_file\System.mdw"
/user myusername
/pwd mypassword
/x mymacro

Any help would be greatly appreciated.

Thanks!
 
Can someone please help me out? I've tried so many different things, and Access still prompts me for a username and password every time I run the batch file.

Thanks in advance.
 
FYI, my problem was that I needed to have all of the commands on one line, instead of hitting "enter" after each command. So the correct syntax would look like this:

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "path_to_my_dB\MyDB.mdb" /wrkgrp "path_to_workgroup_file\System.mdw" /user myusername /pwd mypassword /x mymacro

It executed everything just fine. It logged me into my database with the username and password specified. After it executed the macro, the DOS window closed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top