DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
SITE SEARCH SQLUSA.com HEADLINES NEWS
SQL E/BOOKS   SQL 2014 PROGRAMMING   DOWNLOADS
SCRIPTS SQL 2005 SQL 2008 ARTICLES
SQL JOBS TWITTER FORMAT VIDEOS
How to connect to a SQL Server database from ASP?

The following sample demonstrates how to establish a connection to a database InvMaster:


-- Connect
<%
Dim StrConnInventory
Dim ConnInventory

StrConnInventory = "Provider=SQLOLEDB.1;Data Source=HeadQtr;Initial Catalog=InvMaster;User ID=finance;Password=f!nAnCe**"

Set ConnInventory = Server.CreateObject("ADODB.Connection")

ConnInventory.ConnectionTimeout = 4000
ConnInventory.CommandTimeout = 4000
ConnInventory.Open StrConnInventory
%>

-- Disconnect
<%
ConnInventory.Close
Set ConnInventory = Nothing
%>

Related articles:

How to Connect to Database using a Connection String

Connecting to Databases in ASP.NET

 

Exam Prep 70-461
Exam 70-461
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE