Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle ASP
|
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 14th, 2003, 09:59 AM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting Oracle Database with an ASP page

Hi,

   I want to do a small survey on the net and I wanna store that data in a oracle database. I did the same using Access and it worked well.

   Can anyone help me out in connecting an ASP page with an oracle database. I'd appreciate if anyone provides the code.
 
Old October 12th, 2003, 04:07 PM
Registered User
 
Join Date: Oct 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to TwoCoby
Default

Here is the connection string I use in my ASP code:
-------------------------------
<%
set cnn = Server.CreateObject("ADODB.Connection")
cnnStr ="Provider=ORAOLEDB.Oracle;Data Source=summer5;User ID=scott;Password=tiger;"
cnn.Open cnnStr
%>
-------------------------------
Where Source is the SID in the tnsnames.ora file ... it's also the same as the Service Name in the tnsnames.ora file. (Pretty much it's the name of your Oracle database).

Any questions maybe I can help. Just email me!

Thanks!
-Coby

 
Old October 11th, 2004, 11:34 AM
Registered User
 
Join Date: Oct 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!,
I was trying that connection using Oracle9i and is giving me this error, but if I do it with Oracle8i it works perfectly.
Error:
ADODB.Connection (0x800A0E7A)
Provider cannot be found. It may no be properly installed.

If you have the answer to this error, please send me an email to any of this addresses:
1) [email protected]
2) [email protected]

Thanks...

Quote:
quote:Originally posted by TwoCoby
 Here is the connection string I use in my ASP code:
-------------------------------
<%
set cnn = Server.CreateObject("ADODB.Connection")
cnnStr ="Provider=ORAOLEDB.Oracle;Data Source=summer5;User ID=scott;Password=tiger;"
cnn.Open cnnStr
%>
-------------------------------
Where Source is the SID in the tnsnames.ora file ... it's also the same as the Service Name in the tnsnames.ora file. (Pretty much it's the name of your Oracle database).

Any questions maybe I can help. Just email me!

Thanks!
-Coby

 
Old November 14th, 2004, 05:56 PM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try a function with a different provider....
Put the connection function in an asp

connection to Oracle(ADOFunctions_inc.asp)
<%
Function GetDBConnection()

Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")

With objConnection
.ConnectionString = "Provider=MSDAORA; " & _
"Data Source=your_database; " & _
"User ID=scott; Password=tiger;"
.Open

End With
Set GetDBConnection = objConnection

End Function
%>

Then include the file in your server pages.


then you can simpley use its methods...i.e
Set objRecordset = GetDBConnection().Execute(varSQL)
good luck....







Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to oracle database in struts Manvi Struts 3 August 7th, 2006 10:53 PM
connecting oracle with asp.net rajatake General .NET 2 June 28th, 2005 01:45 AM
Exception connecting to Oracle Database with JDBC celia05es Java Databases 1 March 31st, 2004 04:42 AM
Creating and connecting in a Oracle Database cutovoi Excel VBA 2 February 4th, 2004 07:06 PM
Connecting an oracle database kelitu Oracle 0 September 4th, 2003 09:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.