[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
ASPFAQ_Connect_to_MSAccess_ADODB
ADODB is based on Microsoft's ADO (ActiveX Data Objects) data-access method which is used to connect, navigate and manipulate different databases.
Place the following script in your ASP page. The example is for an MS Access Database. Note that the DBQ Parameter holds the connection location of the database to be used.
For more information about Connection Strings for MS Access and other databases, please see : ConnectionStrings.Com
Or better, if you save this script in its own asp file eg. connection.asp, then you can reference it from any ASP pages. Make sure the ConnectionString appears on a single line.
Set the relevant user id (Uid) and password (Pwd) properties in the ConnectionString. If there are no such settings, leave them as is.
Placed the following script in the top of every ASP file that you want to have a database connection.
The adovbs.inc is a file that comes with IIS. This file has all of the ADO constants defined which are needed when connecting to databases.
Related threads:
plz help!! Access into MS Access Database
Back to ASP FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
ASPFAQ_Connect_to_MSAccess_ADODB
How to connect to an MS Access database using ODBC?
ODBC stands for Open DataBase Connectivity and is a layer that provides a standardised method of data access.ADODB is based on Microsoft's ADO (ActiveX Data Objects) data-access method which is used to connect, navigate and manipulate different databases.
Place the following script in your ASP page. The example is for an MS Access Database. Note that the DBQ Parameter holds the connection location of the database to be used.
For more information about Connection Strings for MS Access and other databases, please see : ConnectionStrings.Com
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="DRIVER={Microsoft Access Driver(*.mdb)};DBQ=D:\lillu\entries.mdb;Uid=;Pwd=;"
Conn.Open
%>Or better, if you save this script in its own asp file eg. connection.asp, then you can reference it from any ASP pages. Make sure the ConnectionString appears on a single line.
Set the relevant user id (Uid) and password (Pwd) properties in the ConnectionString. If there are no such settings, leave them as is.
Placed the following script in the top of every ASP file that you want to have a database connection.
<% @Language=VBScript%> <% Option Explicit %> <!--#include file="adovbs.inc"--> <!--#include file="connection.asp"-->
The adovbs.inc is a file that comes with IIS. This file has all of the ADO constants defined which are needed when connecting to databases.
Related threads:
plz help!! Access into MS Access Database
Back to ASP FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
