Access datatbases

Microsoft Access Databases can be set on our Windows 2003 servers for use with your ASP or Microsoft.Net web application.

Uploading Your Database

You should upload your database file to the /private directory within your web space. Uploading your database to the /private folder will allow your scripts to access the data within it without allowing internet users to download your whole database file.

Connecting To Your Database

You should connect to your access database using a DSN less connection. You may use code such as the following:

gs_Connect = “provider=Microsoft.Jet.OLEDB.4.0;” & _
“data source= e:\domains\joebloggs\private\database.mdb”

gobj_Connect = Server.CreateObject(“ADODB.Connection”)
gobj_Connect.Open gs_Connect

Where e:\domains\joebloggs is the path to your home directory and where joebloggs is your username and the database file is named database.mdb and is situated in the private folder in your account.

DSN less connections are faster and more efficient than ODBC DSN connections as they avoid the need for a registry lookup. Because of this reason, ODBC connections for Access and SQL databases aren’t supported.

Closing Your Database

Please make sure you add a close statement to your ASP scripts to make sure continued reliability with the Jet Database engine. To do so, simply finish your site as follows

gobj_Connect.close
Set gobj_Connect = nothing