Advertisement Jump to content
Sign in to follow this  
ballack

[web] how to establish dsn connection for oracle

This topic is 4881 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi everyone i want to know how to set a dsn for oracle. so that i can access oracle database using asp. thank you in advance.

Share this post


Link to post
Share on other sites
Advertisement
You establish a DSN for Oracle in the same way as any other DSN for use with ASP.

Step 1: Create a System DSN from the Data Sources (ODBC) applet from within Control Panel.

Step 2: From within your ASP code, create a new Connection object:


<%
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
%>


Step 3: Specify the ConnectionString property of your Connection object as being the name of the System DSN you created in Step 1, like so:


<%
Conn.ConnectionString = "DSN=SystemDSN"
%>


So for example, if you called the System DSN from Step 1 myOracleDB, the complete code to setup a DSN would look like the following:


<%
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "DSN=myOracleDB"
%>


Hope that helps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!