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
  • 0 أعضاء وجدوا هذه المقالة مفيدة
هل كانت المقالة مفيدة ؟

Related Articles

Connect to MS Access Database

  Connection String "Provider=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};"...

Microsoft Access .LDB File

The server must have access to the database to read / write information. When the server or user...