VB5 + Oracle 
Author Message
 VB5 + Oracle

I use Visual Basic 5 on Windows 95.
I'm connected to Access 97 databases with tables bound to Oracle 7 via
oracle ODBC drivers; 2.05.03.01.

When Sql error occurs, I always have the message ='Err 3146 ODBC Call
failed'
but I have not the real error message of oracle server.

I tried with Microsoft ODBC drivers with the same result.

Please help me to retrieve the oracle error message.

Thanks in advance



Tue, 20 Feb 2001 03:00:00 GMT  
 VB5 + Oracle

Quote:

> I use Visual Basic 5 on Windows 95.
> I'm connected to Access 97 databases with tables bound to Oracle 7 via
> oracle ODBC drivers; 2.05.03.01.

> When Sql error occurs, I always have the message ='Err 3146 ODBC Call
> failed'
> but I have not the real error message of oracle server.

> I tried with Microsoft ODBC drivers with the same result.

> Please help me to retrieve the oracle error message.

> Thanks in advance

Frederic,

In VB5 the errors are stored in the Errors colection. I wrote a bit of
code which just loops through to get the errors (see attached)

Function fsCheckError() As String
' Trap the "ODBC - Call Failed" message and get the
' expected error.

Dim msErrStr As String
Dim miErrCt As Integer
Dim mbNotOurErr As Boolean

On Error GoTo ErrTrap

    msErrStr = ""
    mbNotOurErr = True
    If Errors.Count > 1 Then
        miErrCt = Errors.Count - 1
        While mbNotOurErr
            If InStr(1, Errors(miErrCt), "ODBC--Call Failed") = 0 Then
                'This is a "bogus" error message raised because we raise
exceptions
                'in our packages to pass information to the front end
                miErrCt = miErrCt - 1
            Else
                'This is the correct message
                mbNotOurErr = False
            End If
            If miErrCt = 0 Then
                'Get out clause
                mbNotOurErr = False
            End If
        Wend
        'Last error is current error
        msErrStr = Errors(miErrCt)
    Else
        msErrStr = Errors(0)
    End If

ErrTrap:
    fsCheckError = msErrStr

End Function

Hope this helps.

Duane



Sat, 24 Feb 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB5 / Oracle 803, Microsoft driver for Oracle 2.73

2. VB6 ug of VB5 Oracle : Invalid Procedure call

3. VB5 Oracle Stored Proc Access - Returning Table datatype

4. VB5 / Oracle 7 ODBC connection

5. VB5/Oracle Datatype-Incompatibility

6. VB5 Oracle 7 Connection Problem

7. VB5/ORACLE DATE FIELD

8. VB5 - Oracle / Stored Procedures

9. VB5 + Oracle

10. VB5 - Oracle Stored Procedures

11. VB5, Oracle 73 and CR 4.6

12. VB5/Oracle Objects for OLE

 

 
Powered by phpBB® Forum Software