Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database connection

Status
Not open for further replies.

parames

MIS
Jun 26, 2000
71
MY
Hi list.. Need help from you all..

My asp codes is in different server and my MS-SQL database is in another server. How to connect to the database in asp using the dsn that i've created in sql server?
Normally we use something like this if the database and the asp is in the same server:
Set AdoDb=Server.CreateObject("ADODB.Connection")
AdoDb.Open "dsn=nmpm;UID=popop;passwd=oppiu"

But how to do this connection if the database and asp is in different server?

Please help..

Thanks and Best Regards,
Parames.s
 
Hi there

Try


OLE DB Method for SQL
<% set cnn = server.createobject(&quot;ADODB.Connection&quot;)
cnn.open &quot;PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=databasename &quot;
%>

Hope This Helps
Bernadette
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top