[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
ASPFAQ_Connect_to_SQLServer_OLEDB
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 userid and password 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_OLEDB
How to connect to an MS SQL Server database using OLEDB?
OLEDB, the successor of ODBC, 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="Provider=SQLOLEDB;Data Source=lillu;Initial Catalog=entries;UserId=sa;Password=;"
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 userid and password 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]
