Solved

Accessing an Oracle database from an ASP page?

Posted on 2003-11-25
11
1,232 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
 
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
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 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

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

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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 video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

947 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

22 Experts available now in Live!

Get 1:1 Help Now