To access your Access database from your web site, follow this procedure:
- Upload your Access database with FTP to your /_private folder located in your web site's root folder. This is the only folder that has the proper permissions for file-based databases for access from the web server.
- Use this connection string in your ASP code:
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\inetpub\xxx\_private\accessfile.mdb;"
You may also request a System DSN to connect to your database.
NOTE: This method is the most reliable and stable method of connecting to an Access database. Using this method allows you to modify the Access file name in your code whenever you need to. It also allows you to connect without requiring a DSN.
Do NOT use the following method! It uses a less stable ODBC driver which can cause your site to fail!
- Conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\inetpub\xxx\_private\accessfile.mdb;"