General discussion

Locked

Connecting to a database remotely

By sheana ·
Hi! I have my ASP pages on one server and my database on another server. Using ASP ADO Connections or any other way you can recommend....how do I connect to the database? I would prefer using ASP. I do not any control over the two servers...they are just two server provided by two different ISP's. It would be great to have the code for a database connection USING DSN.

Thanks.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Connecting to a database remotely

by fromnaija In reply to Connecting to a database ...

What you need in this situation is what is often refer to as DSNless connection. This allows you to specify the name (or IP address?) of the database server in your connection string.
You may find the articles and the examples at the following link of help.

http://www.activeserverpages.com/learn/dbopen.asp

I hope this helps.

Collapse -

Connecting to a database remotely

by sheana In reply to Connecting to a database ...

The question was auto-closed by TechRepublic

Collapse -

Connecting to a database remotely

by wjhunt In reply to Connecting to a database ...

This code I use to connect to SQL Server:
dim strConnect
dim ssrvr

ssrvr="Driver={SQL Server};Server=(local)atabase=Northwind;DSN=LocalServer;"
set oConn=createObject("ADODB.Connection")

oConn.open ssrvr

strConnect = "Select * from Employees order by LastName"

set oProp = oConn.execute(strConnect)

document.write "<table border='1'>"
while not oProp.eof
document.write "<tr><td>" & oProp("EmployeeId") & "</td><td>" & oProp("LastName") & "</td><td>" & oProp("FirstName") & "</td><td>" & oProp("Notes") & "</td>"
oProp.Movenext
wend
document.write "</table>"

oConn.close

Collapse -

Connecting to a database remotely

by sheana In reply to Connecting to a database ...

The question was auto-closed by TechRepublic

Collapse -

Connecting to a database remotely

by sheana In reply to Connecting to a database ...

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums