Wrox Programmer Forums
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 30th, 2008, 04:53 AM
Registered User
Join Date: Jan 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default connection string

How to write the connection string in ASP to connect to SQL Server from my Proxy server.

Old February 14th, 2008, 09:59 AM
Friend of Wrox
Join Date: Dec 2006
Posts: 104
Thanks: 9
Thanked 1 Time in 1 Post

I Normally create an includes connection page for all my SQL connections which make it easy to reference in my asp pages

an example of my connection asp page is

Asp page name - sqlconnection.asp


'Declared SQL connection variables

Dim strSQLSN    ' SQL Server Instance
Dim strSQLDBUN    ' SQL Username
Dim strSQLDBPW    ' SQL Password
Dim strSQLDB    ' SQL Database name

'SQL Server current configuration

strSQLSN = "your-sever-name"                  ' SQL Server Instance
strSQLDBUN = "sql-login-name" ' SQL Username
strSQLDBPW = "your-password"             ' SQL Password
strSQLDB = "your-database-name"                       ' SQL Database name

' Connection String

VirConn = "Provider=SQLOLEDB;Server=" & strSQLSN & ";User ID=" & strSQLDBUN & ";Password=" & strSQLDBPW & ";Database=" & strSQLDB & ";"

Then in the asp pages i want to connect to the db i use


then include

'Open Connect to DB
set dbconn = server.CreateObject ("ADODB.Connection")
    dbconn.connectionstring = VerConn
Hope this helps


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection string MunishBhatia ASP.NET 2.0 Professional 4 May 16th, 2007 05:50 AM
Connection String jmss66 Oracle 4 August 8th, 2006 03:19 AM
Connection String slgknjn VB Databases Basics 2 February 26th, 2005 03:14 AM
Connection String fs22 Classic ASP Databases 3 August 30th, 2004 01:25 AM
Connection String Help. diamond2165 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 7th, 2003 06:09 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.