Solved

Accessing an Oracle database from an ASP page?

Posted on 2003-11-25
11
1,279 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 informatio…
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/…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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