Access, MS Office, Programming

Using a Batch File to Start an Access Application Hosted on a Local Area Network

Microsoft Access
Microsoft Access

If you are creating MS Access applications, then you will probably want to set up custom workgroups and give your users the ability to log into your application as a workgroup user that has various levels of access. You will also want to host the Access application centrally on your LAN to avoid problems with multiple instances of the database existing.

The easiest way set up your application is by creating a custom .MDW (workgroup security) file and hosting this together with your main .MDB database file on your local area network for your users to access. Then in order for your users to be able to launch the application and log in from their desktop machines, you can create a simple batch file for them to click on.

For example, if you had your Access files on a network path such as:

\\MyNetwork\AccessApps\

Let’s assume your users are running MS Access 2002 on a Windows XP machine. This means that on their local machines, the default path to the MS Access executable would be:

C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE

This path above will of course vary based on the version of MS Access and the version of Windows that your users are running.

To have your MS Access database start with the proper security prompt, you need to create a .bat file for your users to click on. In that file you need to enter the following start command for Access to begin with the proper command line switches:

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "\\MyNetwork\AccessApps\MyAccessApp.MDB" /NoStartup /Wrkgrp "\\MyNetwork\AccessApps\MyAccessApp.mdw"

This is a simple, but useful syntax to know.

In this case Access.exe is pointed to the main database file MyAccessApp.mdb, and then assigned the workgroup file MyAccessApp.mdw. The .mdw file path is prefixed with the NoStartup and Wrkgrp switches to tell access that this is a workgroup file that should run behind the scenes for each user.

For further command line switches that you can use with the MS Access executable, have a look at Microsoft’s documentation.

Advertisements

1 thought on “Using a Batch File to Start an Access Application Hosted on a Local Area Network”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s