MindState Internet, Business Solutions Click By Click

NOTICE: New Support Hours!

Check for your domain name
Only $20 per year!

 

  How to connect to an Access database without a DSN.

This sample ASP script shows you how to connect to an Access Database without the need of a DSN.  In this example the connection object is called "Connection".

<% 
' This file contains the connection object to the Access Database.
' Also all global variables shold be defined here.

' This example points to a datbase file "database.mdb" in the
' \db directory. Change /db to the directory your database is in and
' change "database.mdb" to the name of your database file. 

Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/db") & "\database.mdb;DefaultDir=" & Server.MapPath("/db") & ";DriverId=25;FILE=MS Access;MaxBufferSize=512;PageTimeout=5"
%>

Products and Services  Support Center  About the Company  Contact MindState