Help


SQL

DSNless connections

There are two things required to create and use a DSNless connection to a Microsoft SQL Server Database.

Firstly, the connection parameters need to be defined. This can be achieved via the following code:

set con = server.createobject("adodb.connection")
con.open = "Provider=SQLOLEDB.1;Data Source=203.89.205.226;Initial Catalog= “Initial Catalog”;User ID=”User Id”;pwd=”pwd”"

Where Microsoft SQL server connection string parameters are:
“Initial Catalog” = the actual database on the SQL server
“User Id” = your SQL server user id
“pwd” = your SQL user id password


Secondly, to utilize this connection you will need to define the query. The following code is an example of this:

Set test = Server.CreateObject ("ADODB.Recordset")
test.Open "SQL QUERY", con

Where “SQL QUERY” is action you want to perform on the database written in SQL.

Index  Top