HELP: VB4.0 / 32Bit Stack fault on CONNECT 
Author Message
 HELP: VB4.0 / 32Bit Stack fault on CONNECT

I am using VB4.0 / 32bit, and my applications are going well, but
whenever I'm in the VB4.0 development environment, and performing
connect & disconnects , I regularly get stack fault when calling the
oracle object's (Version 2.0). See the attached fragment of code....

It doesn't seem to matter where I call the code from, a button, a
Load() event, the timer - it will run a few times then give the stack
fault message, usually then causes VB to GPF.

I would like to *RELIABLY* be able to do this as it's driving me
bananas - everything *seems* to be OK when the app is compiled into an
EXE, but I'm still not sure...

The stack fault comes from the call to OpenDatabase.

TIA
Paul 'Syd' Smith

'
' Try and open a connection to the given database using
' the given database name and connect string.
'
'  Return Values:
'
'    0      - Connected
'    Others - Not Connected: Oracle error number
'
Function Connect(ByVal DbaseName As String, ByVal ConnectString As
String) As Long

    'Set up an error handler.
    On Error GoTo errhandler

    'Create the OraSession Object.
    If TypeName(glbOraSession) = "Nothing" Then
        MsgBox "ERROR: Trying to recreate an open session"
        Connect = -1
        Exit Function
    End If

    Set glbOraSession = CreateObject("OracleInProcServer.XOraSession")

    If TypeName(glbOraSession) = "Nothing" Then
        TRACE "ORACLE.CLS", "Connect", TRC_ORAERR, "Oracle Session
object not created"
    End If

    'Create the OraDatabase Object by opening a connection to Oracle.
    Set glbOraDatabase = glbOraSession.OpenDatabase(DbaseName,
ConnectString, ORADB_DEFAULT)

    If TypeName(glbOraDatabase) = "Nothing" Then
        TRACE "ORACLE.CLS", "Connect", TRC_ORAERR, "Oracle Database
object not created"
    End If

    Set glbOraParams = glbOraDatabase.Parameters
    Connect = 0
    Exit Function

errhandler:
    If Err = 28 Then
        Debug.Print "Stack fault"
    End If
    'Check to see if an Oracle error has occurred.
    If glbOraSession.LastServerErr <> 0 Then
        TRACE.Output "ORACLE.CLS", "Connect", TRC_ORAERR,
glbOraSession.LastServerErrText
        Connect = glbOraSession.LastServerErr
    Else 'Must be some non-Oracle error
       If glbOraDatabase.LastServerErr <> 0 Then
           TRACE.Output "ORACLE.CLS", "Connect", TRC_ORAERR,
glbOraDatabase.LastServerErrText
           Connect = glbOraDatabase.LastServerErr
       Else 'Must be some non-Oracle error
           TRACE.Output "ORACLE.CLS", "Connect", TRC_VBERR, Err,
Error(Err)
           Connect = Err
       End If
    End If
    TRACE.Output "ORACLE.CLS", "Connect", TRC_ORAERR, "Connect String
= " & ConnectString
    Exit Function
End Function

--
Paul Smith
Technical Manager, SDR Systems Ltd
Please change Compuserve.comz to Compuserve.com to respond via Email



Fri, 19 May 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Out of Stack 28 using VB4-32bit with Office 97 Installed

2. Out of Stack 28 using VB4-32bit with Office 97 Installed

3. Invalid Page Fault in VB4(32bit)

4. VB4(16): Stack Fault when printing to Delrina WinFax 4.0

5. VB4 (16 Bit), CTL3D Stack Fault, and WFW311

6. Connecting 2 Win95 PC via VB4 32bit?

7. ODBC Connect to ORacle 7.1 with VB4.0 (32bit)

8. VB4 Visigenic 32Bit ODBC driver connecting to Oracle 7

9. RDO-Invalid page fault-Stack dump- HELP!!

10. HELP******* VB4 32bit NOT SETTING FOCUS CORRECTLY *********HELP!

11. Out of stack space errors and GP Faults in Access on Compaq Presario

12. Oracle - Stack Fault in CTL3D.DLL

 

 
Powered by phpBB® Forum Software