Knowledgebase: Database
MS SQL
Posted by - NA - on 17 September 2005 08:22 PM
 
  • Open your Client Network Utility (Start -> Programs -> Microsoft SQL Server 7.0 or 2000 -> Client Network Utility)
  • Click "Add" to add our server to your list.
 
 
  • On the "Add Network Library Configuration Form" enter the following information:
Server Alias - ACCUSQL1, Pluto, Mars
Network Library - TCP/IP
Computer Name - 72.18.135.38
Port Number - 1533
  • Click "OK"
  • Click "OK" - This will close out the Client Network Utility.
 
 
  • Open Enterprise Manager. Right Click "Microsoft SQL Servers" and select "New SQL Server Registration" This will open a wizard. Click Next.
 
 
  • Select "Pluto" from the list of available servers and "Add" it. Click Next.
 
 
  • Choose to connect using SQL Server Authentication
 
  • Enter your assigned username and password. Keep on clicking next until the wizard is completed.
 
 
 
SQL server database connection ASP code.
  • DSN less connection
Dim SqlConn

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

SqlConn.ConnectionString="Driver={SQL Server};" & _
"Server=72.18.135.38,1533;" & _
"Database=dbname;" & _
"Uid=username;" & _
"Pwd=password;"
SqlConn.Open
Response.Write "SQL Connection Successful"
 
  • DSN based
Dim SqlConn
Set SqlConn = Server.CreateObject("ADODB.Connection") & _
SqlConn.ConnectionString = "Provider=sqloledb;" & _
"DSN=sqltest;Initial Catalog=pubs;" & _
"User Id=test;" & _
"Password=test"
SqlConn.Open
Response.Write "SQL Connection Successful"
(590 votes)
This article was helpful
This article was not helpful

Comments (0)
Help Desk Software by Kayako Resolve