Here is a connection string that attaches to an instance of SQL Server that is NOT the default instance.
<% cst = "Provider=SQLOLEDB;" & _ "Data Source=127.0.0.1\instanceName;" & _ "Initial Catalog=pubs;" & _ "Network=DBMSSOCN;" & _ "User ID=<uid>;" & _ "Password=<pwd>" set conn = CreateObject("ADODB.Connection") conn.open cst %> |
If your instance is running on a non-default port (by default, SQL Server runs on 1433):
<% cst = "Provider=SQLOLEDB;" & _ "Data Source=127.0.0.1,1510\instanceName;" & _ "Initial Catalog=pubs;" & _ "Network=DBMSSOCN;" & _ "User ID=<uid>;" & _ "Password=<pwd>" set conn = CreateObject("ADODB.Connection") conn.open cst %> |
For more information on connection strings, see
Article #2126.