Oracle error occurred, but error message could not be retrieved from Oracle

Posted on 2009-04-20
Last Modified: 2012-05-06
I have a vb6 application that is trying to connect to a oracle database
my connection string:
"Provider=MSDAORA; Password=test; User ID=test ; Data Source = T; Persist Security Info=True"

I ran a tnsping on T and it works perfectly (and other applications can connect to T)
the error occurs when the connection is opened
On Error GoTo ErrorHandler

    Dim conn As New ADODB.Connection

    Dim cmd As New ADODB.Command

    Dim RS As New ADODB.Recordset


    conn.ConnectionString = ConStr



    cmd.ActiveConnection = conn

    cmd.CommandText = "select 1 from test"

    cmd.CommandType = adCmdText


    RS.Open cmdCommand


    If RS.EOF = False Then



            MsgBox (RS.Fields(0))

        Loop Until RS.EOF = True



    End If




        MsgBox Err.Number & ": " & Err.Description

    Resume Next

Open in new window

Question by:james2432
    LVL 15

    Expert Comment

    Try to add error processing, like the following:

    MsgBox (conn.Errors(0).Description)

    If top level error message is not informative enough,  check all messages in errors collection

    Also check if there are several Oracle homes, some of them may have no record for this database in tnsnames.ora
    LVL 1

    Accepted Solution

    Decided to use another provider(and it works)
    "Driver={Microsoft ODBC for Oracle};Server=t;Uid=test;Pwd=test;"

    as for the
    MsgBox (conn.Errors(x).Description)
    I've already went throught them before hand and saw nothing that really helps
    LVL 15

    Expert Comment

    I impressed
    "saw nothing that really helps"
    LVL 1

    Author Comment

    by that I mean I had already checked/tried to fix those errors and it amounted to nothing

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now