Server Gigabit Guide

Connect to MS SQL Server Database

You are here:
Estimated reading time: < 1 min

Connect to MS SQL Server Database

Connection String
“Provider=SQLOLEDB; ” & _
“Data Source = SQLServerIP,SQLServerPortNumber; ” & _
“Initial Catalog = YourDatabaseName; ” & _
“User ID = YourDatabaseUserID; ” & _
“Password = YourDatabasePassword”

 

You can use sample code below to connect to your MS SQL Server’s database:

ConnectionString = “Provider=SQLOLEDB; Data Source = 72.18.131.233,1533; ” & _
“Initial Catalog = Northwind; ” & _

“User ID = SampleUser; ” & _

“Password = SamplePassword”

Set Conn = Server.CreateObject(“ADODB.Connection”)
Conn.ConnectionString = ConnectionString
Conn.Open

For more information, you can refer to the following articles. Microsoft OLE DB Provider for SQL Server error ‘80040e4d’

Was this article helpful?
Dislike 0
Views: 76