0

ASP - MS Access basic connection

Wednesday, November 7, 2007

<%
'==============================================
' Test MS Access Connection
' This test can be used on .NET 1.1 and 2.0
' Testing only the connection to the database
' Make sure that the IUSR = Modify on the database
'==============================================

'Dim the variables
Dim dbPath, conObj

'SET THE VARIABLES HERE
dbPath = "c:\accounts\username\wwwroot\sample.mdb"


'create the connection object
set cnn = server.createobject("ADODB.Connection")

'open connection
cnn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+ dbPath +""

'
'This is where you would do stuff with the database
'

'close the connection and kill the object
cnn.close
Set cnn = Nothing
%>

Test Access



Test MS Access Connection

If you do not see any errors then the connection was successful


0 Responses to "ASP - MS Access basic connection"