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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to sql-server from asp

Status
Not open for further replies.

zuza

Programmer
Nov 9, 2003
54
0
0
YU
Dear all,

untill now my asp pages was on the same server as sql-server, so I'm connected to sql-server with dsn and normally create (give) access to the iusr_machinename (default IIS user) in order to work the connection between asp and sql-server.
But, now I have asp pages on server Intranet and source on server called SQL-SErver, how do I make the connection ??

Thnx,
ZuZa.
 
Hi.

You make the connection in the same way you did, but you're probably better off using SQL authentication, rather than windows.

Here's an example ActiveConnection value...

Provider=sqloledb;Data Source=SQL-Server-IP-or-Name;Initial Catalog=YourDatabaseName;User Id=username;Password=password

The "Data Source", "Initial Catalog", "User Id" and "Password" should be altered to suit, but that's the only difference between local and hosted database connections.

If you need more help, just ask.

John.

mf_of_john.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top