Working with Access databases that live outside of a Web site
We had a customer recently, who needed to access an Access database from both a classic ASP page and from another Access database. To prevent the database from being locked by IIS, the customer wanted to know if they could move the database out of the Web site directory. By default, FrontPage expects the database to be in the Web site. However, when they did this, it seemed to break FrontPage’s ability to work with the database connection as Front Page.
Bernardo Iturriaga Dubost, one of the FrontPage testers, came to the rescue of this customer. Here's his response:
The main reason that FrontPage stores the .mdb files in the web is so that you don’t need to access to the Web server to access the data in a database. However, you can provide dual access to a database by using a system DSN, and then using the DSN in FrontPage to connect to the database. Here's how:
First, you need to create a system DSN on the Web server that hosts the Web site:
- From the Start Menu, click All Programs.
- Select Administrative Tools, and click Data Sources (ODBC) .
- Go to the System DSN tab.
- Click Add.
- Select the appropriate driver type (for example, MS access driver).
- Click Finish.
- Provide a name and a description for the DSN.
- Click Select the navigate to the actual .mdb file located in another folder on the server.
- Click Ok when you're finish selecting the database.
- In most cases this is enough, but if the database requires a password, you'll need to provide one. To do this, click Advanced and provide the password.
- Click Ok again to create the DSN.
After you're finished, you'll see your new named DSN listed on the System DSN tab of the ODBC Data Source Administrator.
Next, you need tell FrontPage to use the DSN to connect to the database.
- Start FrontPage and open the Web site.
- From the Tools menu, click Site Settings.
- On the Database tab, click Add.
- In the dialog select System Data source on web server.
- Click Browse. FrontPage displays a list of system DSN on the Web server.
- The connection that you created in the previous steps should be there, select it and click Ok.
- Click Ok to the Site Settings dialog box, this will add the connection string to the global.asa file in the Web site.
- You can now use this connection to the database for database features in FrontPage for both ASP and ASP.NET.
Please note that in order to do this, you need to have access to the actual server that hosts the Web site. One benefit of this configuration is that you can have different permissions for the Web site and for the folder that contains the .mdb file. Please also note that for the users to get data when they browse, MACHINENAME_IUSR needs to have the appropriate read/write access permissions to the .mdb file; otherwise there will be an error.