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

ASP and ORACLE

Status
Not open for further replies.

Daft69

Programmer
Nov 28, 2001
9
BE
Can someone give me example of a "DataConn.open" !

thanks
 
Depending on your network setup, you may want to use a DSN. Setting one up on your web server to access the database can be done through your control panel --> administrative --> ODBC data sources --> Follow the wizards to set one up. You can then use it like this:

dim strCon
strCon = "DSN=dsnName;UID=userName;PWD=password"
dim con
set con = server.createObject ("ADODB.Connection")
con.open strCon

I found that in a network setup where your DNS server isn't physically located in the general proximity of your web/data server, and your web and data server are separate, AND your web and data server are on the same subnet (i.e. you can name your data server rather than providing an IP address), a DSN using your data server's name is MUCH faster than using a DSN-less connection. There is also the fact that using a DSN makes your applications more portable since you only have to change the DSN in order to point all your applications to another database.

At any rate, if you want to use a DSN-less connection, just replace the strCon = "..." with this:

strCon = "Provider=MSDAORA.1;Password=password;User ID=userName;Data Source=10.0.0.3;Persist Security Info=True"

of course replacing the IP, UserName, and Password with the correct information.

hope that helps! :)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top