Keyline IT Solutions PVT Limited
Please Login or Register

Knowledgebase

Connecting to MSSQL with out a DSN

You can use the following string to connect to MSSQL with out a DSN. It uses an OLEDB connection string to connect to a Microsoft SQL Server 200 database from within ASP:

<%
Dim conn

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

conn.Open "Provider=SQLOLEDB; Data Source =mssql.server.com; Initial Catalog = mydatabase; User Id = USER; Password=PASSWORD; Network Library=dbmssocn;"

If conn.errors.count = 0 Then

Response.Write "Connected OK"

End If
%>


In the example above, mssql.server.com is the MSSQL server, USER is the username and PASSWORD is the password which was provided to you in your MSSQL account setup mail

 



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article


Powered by WHMCompleteSolution

Language:

Quick Navigation

Client Login

Email

Password

Remember Me

Search