Tuesday, December 4, 2007

How do you use ASP access SQL Server through DNS(ODBC)

How do you use ASP access SQL Server through DNS(ODBC)

Use ASP access SQL Server through DNS(ODBC)

<%

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

conn.Open "DSN=tenderproject;UID=tenderproject;PWD=tender"

set rs=Server.CreateObject("ADODB.Recordset")

%>

Server.CreateObject("ADODB.connection") it is use initiated a connection to your SQL Server database.

In this case we are using a data source name called Tenderproject. We also provide a UserID (UID=tenderproject) and password (PWD=tender) as shown in the coding above.

No comments: