[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-04-20
4
Medium Priority
?
2,822 Views
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
    conn.Open
    
    cmd.ActiveConnection = conn
    cmd.CommandText = "select 1 from test"
    cmd.CommandType = adCmdText
    
    RS.Open cmdCommand
    
    If RS.EOF = False Then
        RS.MoveFirst
        Do
            MsgBox (RS.Fields(0))
        Loop Until RS.EOF = True
        
        RS.Close
    End If
    conn.Close
    
ErrorHandler:
        MsgBox Err.Number & ": " & Err.Description
    Resume Next

Open in new window

0
Comment
Question by:james2432
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:OMC2000
ID: 24185892
Try to add error processing, like the following:

ErrorHandler:
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
0
 
LVL 1

Accepted Solution

by:
james2432 earned 0 total points
ID: 24186010
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
0
 
LVL 15

Expert Comment

by:OMC2000
ID: 24186184
I impressed
"saw nothing that really helps"
0
 
LVL 1

Author Comment

by:james2432
ID: 24186305
@OMC2000
by that I mean I had already checked/tried to fix those errors and it amounted to nothing
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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 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