Printable Version
 Updates

 Documentation

 Support & Training

 Community
  Online Forum
  Newsgroups
Deploying an Access Database to a Remote Server

Products:   
Areas: ASP 

When using an Access database and the project is published to a location other than the development machine, the Server side database connection has to be configured to reflect the location of the Access database on the server. In the case where you know the exact file system location of the database file, you can simply copy the design time connection string and paste it under the Server tab then change the file location. For instance, if the Access file is located at C:\Inetpub\databases\project1\database.mbd, the corresponding connection string would be:

Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\Inetpub\databases\project1\database.mbd;Persist Security Info=False

However, it might be that you don't know the file system location of the database file since you are using a commercial host. In this case, you can make use of the VBScript Server.MapPath function to automatically retrieve the path to the file. To do so, you would need to edit the connection string within the common.asp file and include a call to the function. An example connection string using the Server.MapPath function would be:

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & Server.MapPath("database.mdb") & ";Persist Security Info=False"

In the above case, the database file resides in the same location as the generated common.asp page. The Server.MapPath function retrieves the appropriate file system path and includes it in the connection string.

Note that if you are using an ODBC connection, you don't need to specify any path. You would simply create s similarly named ODBC DSN on your local system and use it for the Design time connection then specify the Server side connection to be the same as the Design connection.



Viewed 22835 times.   Last updated: 1/15/2003 8:28:58 PM