Solved

Accessing an Oracle database from an ASP page?

Posted on 2003-11-25
11
1,228 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
Comment Utility
"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
Comment Utility
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
Comment Utility
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
 
LVL 2

Author Comment

by:DalTXColtsFan
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 4

Expert Comment

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

Expert Comment

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

Author Comment

by:DalTXColtsFan
Comment Utility
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
Comment Utility
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
Comment Utility
UPDATE

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

Thanks
Joe
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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 …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

11 Experts available now in Live!

Get 1:1 Help Now