Solved

Accessing an Oracle database from an ASP page?

Posted on 2003-11-25
11
1,269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using Classic ASP inside HTML pages 2 71
VBScript on Html 15 59
Filktering Alphabetically 8 44
Want an individual results display div 8 48
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/…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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