Solved

ASP-Oracle9i COnnection Problem.

Posted on 2004-07-30
7
388 Views
Last Modified: 2010-08-05
Hi People.

i have installed Oracle OLEDB Provider but i am unable to connect to the Oracle 9i DB.

My Page Looks like this

<%
     Set objConn = Server.CreateObject("ADODB.Connection")
     
     objConn.Open "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=scott;Password=tiger;Data Source=ned;"  
     
     Set objRs = objConn.Execute("SELECT * FROM EMPLOYEE")

     Response.Write "<table border=1 cellpadding=4>"
     Response.Write "<tr>"

     For I = 0 To objRS.Fields.Count - 1
       Response.Write "<td><b>" & objRS(I).Name & "</b></td>"
     Next

     Response.Write "</tr>"

     Do While Not objRS.EOF
       Response.Write "<tr>"

       For I = 0 To objRS.Fields.Count - 1
         Response.Write "<td>" & objRS(I) & "</td>"
       Next

       Response.Write "</tr>"

       objRS.MoveNext
     Loop

     Response.Write "</table>"

     objRs.Close
     objConn.Close
   %>

Error i get is :
Error Type:
ADODB.Connection (0x800A0E7A)
Provider cannot be found. It may not be properly installed.
0
Comment
Question by:mcse20002000
7 Comments
 
LVL 2

Author Comment

by:mcse20002000
ID: 11681644
I have MDAC 2.7 Installed
0
 
LVL 1

Expert Comment

by:buff_butler
ID: 11682766
Do you have the orracle TNS names entry set up properly?  Looking at the code it would be called 'ned'?
0
 
LVL 14

Expert Comment

by:aelatik
ID: 11683352
Try changing the provider from OraOLEDB.Oracle.1 to MSDAORA
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Accepted Solution

by:
joeposter649 earned 500 total points
ID: 11685923
Make sure IUSER_computername has permissions for the folder where the Oracle provider is installed.  
To help troubleshoot this you could also set IIS to run under your id or convert your asp script to vbs and run from the command prompt.
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 11685926
BTW, MSDAORA has limitations such as you can't acess clobs and blobs.
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 11697187
Here's what I mean about the vbs script...

Create test.vbs with the following code then exucte it at the command prompt...

Set rs = CreateObject("ADODB.Recordset")
cnstr = "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=scott;Password=tiger;Data Source=ned;"  rs.Open "select sysdate from dual", cnstr, 3, 3
WScript.echo rs("sysdate")
rs.Close
Set rs = Nothing
0
 
LVL 2

Expert Comment

by:cheyennejk
ID: 11898864
I use Oracle 9i and the code below works. (This assumes that Oracle is installed in the default  port. If not, then the port # must be included in the connection string)


Try something like this:


StrConnect="Provider=MSDAORA.1;Data Source=database_scheme;User Id=user_name;PASSWORD=database_password;"


set  objConnection=server.createobject("adodb.connection")
 objConnection.open StrConnect


varSQL = "SELECT DISTINCT USER_ID FROM EMPLOYEE"

set rstemp = objConnection.Execute(varSQL)  


Do While NOT temp_record_set .EOF
 
   Response.Write "<td><b>" &  rstemp (0)  & "</b></td>"
  rstemp.MoveNext
Loop

   rstemp.close
   set rstemp=nothing
         
  objConnection.close
   set objConnection=nothing

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now