[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
ASPFAQ_Connect_to_SQLServer_ADODB
ADODB is based on Microsoft's ADO (ActiveX Data Objects) data-access method used to connect, navigate and manipulate different databases.
Place this script in the top of your ASP page where you access the database from.
Or better, if you save this script an asp file eg. connection.asp, then you can reference it from any ASP page. 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 this 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:
connecting to a sql server database
Back to ASP FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
ASPFAQ_Connect_to_SQLServer_ADODB
How to connect to an MS SQL Server database using ODBC?
ODBC stands for Open DataBase Connectivity and provides standard data access.ADODB is based on Microsoft's ADO (ActiveX Data Objects) data-access method used to connect, navigate and manipulate different databases.
Place this script in the top of your ASP page where you access the database from.
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="DRIVER={"Driver={SQL Server}};Server=lillu;Database=entries;Uid=sa;Pwd=;"
Conn.Open
%>Or better, if you save this script an asp file eg. connection.asp, then you can reference it from any ASP page. 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 this 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:
connecting to a sql server database
Back to ASP FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
