Hi there,
I'm using asp.net (c#) framework version 1.1 and trying to

connect to my Oracle database 10G (10.) which installed

on the same server as the IIS and I'm getting the following

error:
OleDbException (0x80004005): error while trying to retrieve text for error ora 01019

I can connect through sqlplus and I did give aspnet user full

control on my Oracle_Home.
In addition I defined the ORACLE_HOME in the system

environment and in the system PATH.
although I had few oracel version installed I removed them all

(from the registery as well) and now I only got this 10G as my

only Oracle_Home.

this is the code I'm using for openning the db connection:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;


string constr = "Provider=MSDAORA.1;Data Source=wstdb;User

Id=stdb;PASSWORD=stdb;OLE DB Services=-2";
OleDbConnection conn = new OleDbConnection(constr);
conn.Open();

I got the error while opening the connection.

I realy need help.

Thanks,
Adi

Dani AI

Generated

This specific message usually means the Oracle client your app is loading cannot find its own message files, not just that ORA-01019 occurred. On Windows those files live under ORACLE_HOME\rdbms\mesg (for example, oraus.msb). If PATH or the registry points to an old Oracle Home, the client loads the wrong DLLs, fails to load its message catalog, and you see "error while trying to retrieve text for error ORA-01019". That aligns with finding 9i remnants in the registry. Prefer Oracle’s client/provider over Microsoft’s MSDAORA, which only supports Oracle up to 8i and is very sensitive to PATH order. (getupdates.oracle.com, learn.microsoft.com)

Quick checks that typically fix this on IIS/ASP.NET 1.1:

  • Registry: ensure only the 10g home you intend is active under HKLM\SOFTWARE\ORACLE\KEY_HOMENAME and that ORACLE_HOME there matches your 10g path. Then make sure %ORACLE_HOME%\bin comes before any older Oracle folders in PATH. Recycle IIS. (docs.oracle.com)
  • Naming: if tnsnames.ora is messy or you are unsure which TNS_ADMIN is in effect, try EZCONNECT to bypass tnsnames (//host:port/service_name). (docs.oracle.com)
  • Bitness: match the app pool bitness to the Oracle client (32-bit app -> 32-bit client). (docs.oracle.com)

If you must stay with OLE DB, switch to Oracle’s provider (OraOLEDB.Oracle). Otherwise, using Oracle’s ODP.NET avoids MSDAORA’s limits. Example with EZCONNECT:

// Requires Oracle client + ODP.NET (Oracle.DataAccess)
using Oracle.DataAccess.Client;

var cs = "User Id=stdb;Password=stdb;Data Source=//localhost:1521/wstdb";
using (var conn = new OracleConnection(cs))
{
    conn.Open();
    // use the connection...
}

Once the correct Oracle Home is first in PATH and the provider is switched, the message text returns and connections open cleanly. (docs.oracle.com)

Recommended Answers

All 5 Replies

Recheck your Connection String :

pseudo_code:

oConn.Open "Provider=msdaora;" & _
           "Data Source=MyOracleDB;" & _ 
           "User Id=myUsername;" & _
           "Password=myPassword"

Check my website (in sig below) for a link to the Microsoft Oracle Provider and you can download it from

For example You have msdaora.1 as your provider in the connection string.

Hope this helps

Thanks Paladine.
I did install the oracle provider as u suggest and try to change the mdsaora.1 to mdsaora but still same problem...

any other suggestion?

Thnaks again. :)

Hmmm

I love a challenge. **note: Please provide the error message you get **

OK I am at work right now on a break, so i will have to check it out tonight when I get home.

I will Post back then!

EDIT: Some information came to light --->


I would assume with the changes made your code would look similar to this:
(Note case as well, C# is case sensitive, not like VB.NET)

// Setup connection string to access Oracle9 database
        // using the TNSNAMES connect string ARK2
        string connectionString = "Provider=MSDAORA;" +
        "Data Source=ARK2;User ID=scott; Password=tiger";

        // Instantiate the connection, passing the
        // connection string into the constructor
        OleDbConnection con = new OleDbConnection(connectionString);

        // Open the connection
        con.Open();

        // Create and execute the query
        OleDbCommand cmd = new OleDbCommand("SELECT ename,job FROM emp",con);
        OleDbDataReader reader = cmd.ExecuteReader();

        // Iterate through the DataReader and display row
        while(reader.Read()) {
            Console.WriteLine("{0} - {1}",
            reader.GetString(0), reader.GetString(1));

Or did your code follow the managed provider from Microsoft ?

i.e.

using System.Data.OracleClient;
OracleConnection conn = new OracleConnection("Data Source=oracledb;
    User Id=UserID;Password=Password;");

You could try using a DSN rather than this method that you are getting the error on(DSN-less)

i.e.

ConnStr = "Provider=MSDAORA;DSN=oracle;";

But again I will look more into it when I get home! :cheesy:

Thanks Paladine.
I did install the oracle provider as u suggest and try to change the mdsaora.1 to mdsaora but still same problem...

any other suggestion?

Thnaks again. :)

Hi,
I figured it out and here is what I did:
I've notice that I still have leftover of Oracle9i footprints in some of the registry key such as InprocServer32 so I change the value to the existing OracleHome -10 to E:\oracle\product\101~1.0\Db_1\bin\oradc.ocx
After a reboot it partially worked and gave me another error : tns could not find service name although it's properly configured.
Then I took the same code to a new project and it worked!!!

It's very strange but we are dealing with computers....

Paladine, Thanks a lot.
I realy appreciate it :-)

Cheers,
Adi

GREAT!

My pleasure!

Well that works, not if I can only get mine to work over the network. Arrrggh! Hehe, oh well.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.