|
Subject:
|
Connecting Oracle Database with an ASP page
|
|
Posted By:
|
krisvamshi
|
Post Date:
|
8/14/2003 9:59:35 AM
|
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.
|
|
Reply By:
|
TwoCoby
|
Reply Date:
|
10/12/2003 4:07:31 PM
|
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 
|
|
Reply By:
|
luisbueno
|
Reply Date:
|
10/11/2004 11:34:30 AM
|
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) luis.bueno@cemcolon.com.do 2) acde128@hotmail.com
Thanks...
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 
|
|
Reply By:
|
marks20101
|
Reply Date:
|
11/14/2004 4:56:26 PM
|
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. <!-- #include file="ADOFunctions_inc.asp " -->
then you can simpley use its methods...i.e Set objRecordset = GetDBConnection().Execute(varSQL) good luck....
|