Before you can access your MS-SQL Server database from your ASP code , you need to connect to it using one of the following available methods:
1. Connect to a MS-SQL database with OLEDB:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=SQLOLEDB; Data Source=(serverIP); Initial
Catalog=your_database_name; User ID=your_username; Password=your_password"
objConn.Close
Set objConn = Nothing
2. Connect to a MS-SQL Server database with MS-SQL Driver:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={SQL Server};" & _
"Server=(serverIP);" & _
"Database=your_database_name;" & _
"Uid=your_username;" & _
"Pwd=your_password;"
objConn.Close
Set objConn = Nothing
PS: change the (serverIP) to match your conn string
for example if you mssql hostname is: 127.0.0.1,123
then you have to change the string from
Server=(serverIP);
to
Server=127.0.0.1,123;