Solved

Accessing an Oracle database from an ASP page?

Posted on 2003-11-25
11
1,238 Views
Last Modified: 2007-12-19
Greetings all,

I have a machine with the Oracle 9i client installed on it.  The server (on another machine) is 8.1.7.3.  The ASP application I've been assigned to customize accesses a lot of COM+ components which access the database.  The ASP code that was given to me *never* accesses the database directly, only the COM+ components do that.

The change I need to make involves accessing the database.  I would really rather do that in the ASP code as opposed to developing a COM+ component (which may STILL not even work!!!).

Everything I try to access the database directly gives me some sort of error that the Oracle OLEDB driver is not found.

The developers told me that one of the COM+ components exposes its own ADO connection to the database as a property.  I tried that:

Dim rsGetStoreNumber

    Dim strSQL
    Dim adoConnection
    Dim objMyComPlusDBConnection

    Set objMyComPlusDBConnection = CreateObject("MyComPlusApp.objMyComPlusDBConnection")
    Set adoConnection = CreateObject("ADODB.Connection")
    adoConnection.Open objMyComPlusDBConnection.ADODBConnectionProperty

The error I get is:

ADODB.Connection error '800a0e7a'

Provider cannot be found.  It may not be properly installed.

/mywebappname/myfilename.asp, line 84


I tried doing it by brute force by opening VB 6.0 and opening a DataProject project and using that to construct connection strings for me - I tried choosing Oracle Provider for OLE DB, Microsoft OLE DB Provider for ODBC Drivers and Microsoft OLE DB Provider for Oracle and got 3 different versions of "provider may not be installed" errors.

The COM+ components are clearly able to access the database, as are any ADO apps I write in VB.

Any ideas why I'm having trouble getting to them through ASP???

Thanks!

Joe

0
Comment
Question by:DalTXColtsFan
  • 6
  • 3
11 Comments
 
LVL 4

Expert Comment

by:kblack15217
ID: 9819147
"The developers told me that one of the COM+ components exposes its own ADO connection to the database as a property.  I tried that:

Dim rsGetStoreNumber

    Dim strSQL
    Dim adoConnection
    Dim objMyComPlusDBConnection

    Set objMyComPlusDBConnection = CreateObject("MyComPlusApp.objMyComPlusDBConnection")
    Set adoConnection = CreateObject("ADODB.Connection")
    adoConnection.Open objMyComPlusDBConnection.ADODBConnectionProperty"

--------------------------
Joe,
Heres the thing.   If objMyComPlusDBConnection.ADODBConnectionProperty is an ADO connection object, then you are opening a connection with a connection.   You can either set your own connection to this

Set adoConnection = objMyComPlusDBConnection.ADODBConnectionProperty

OR just use it

if objMyComPlusDBConnection.ADODBConnectionProperty.State = 1  ' its open.



0
 
LVL 2

Author Comment

by:DalTXColtsFan
ID: 9819196
made that change, didn't help :(  same error.

I don't think I'm trying to open a connection with a connection though - ASP might be different from VB, but in VB the default property of the connection object is its connection string, i.e. I can say

?adoConnection

in the debug window and it will print the connection string.

Any other ideas???
0
 
LVL 2

Author Comment

by:DalTXColtsFan
ID: 9819210
By the way, I tried just using it too, i.e.

set rsRecordset = CreateObject("ADODB.Recordset")
rsRecordset.Open sSQL, objMyComPlusDBConnection.ADODBConnectionProperty, 0, 1

and I get the same error :(.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 2

Author Comment

by:DalTXColtsFan
ID: 9819286
Possible correction - that property of the COM+ object might be a string, not an ADO Connection object - the developers are really busy and haven't gotten back to me yet, but I think that property is a string because when I try:

Set adoConnection = that thing

I get an error "Object required '[String: "Provider=OraOLEDB.Or"].

Is there some special that has to be installed as part of IIS or Oracle for ASP to be able to access Oracle?
0
 
LVL 4

Expert Comment

by:kblack15217
ID: 9820844
Well, you need the Oracle Drivers installed on the server.  
0
 
LVL 4

Expert Comment

by:kblack15217
ID: 9820846
You will also need the DSN set up, if the connection string is to a DSN
0
 
LVL 2

Author Comment

by:DalTXColtsFan
ID: 9820880
The connection string is not to a DSN.

When I launch VB and choose Data Project, then double-click DataEnvironment1, right-click Connection and click Properties, the list of OLE DB Providers includees:

Microsoft OLE DB Provider for ODBC Drivers
Microsoft OLE DB Provider for Oracle
Oracle Provider for OLE DB

and when I go to Data Sources and click the Drivers tab, I see

Microsoft ODBC for Oracle
Oracle in OraHome92

Any other thoughts???
0
 
LVL 2

Author Comment

by:DalTXColtsFan
ID: 9825286
UPDATE

Apparently there is a user called IUSR_abunchofstuff created when you install IIS.  Acting on something I saw in a webpage I added this user to Administrators (something about it not being able to "see" the BIN directory of the oracle home where the ODBC and OLEDB DLLs are).  This solved the "it might not be properly installed" error but now I'm getting:

OraOLEDB error '80004005'
?

on the ASP page.

Help? :(
0
 
LVL 2

Accepted Solution

by:
DalTXColtsFan earned 0 total points
ID: 9827057
UPDATE

Installing MDAC 2.8 solved the other problem.  Now it works.

Thanks
Joe
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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