0 Replies Latest reply on Feb 14, 2007 8:56 AM by 561744

    Asynchronous call with OO4O

    561744
      Hello,

      I have a problem. The asynchronous call worked faultlessly under Oracle DB 10.2 and Oracle client 9.2. After the rearrangement to Oracle client 10.2 the VB6 function cannot be ended correctly. If I install the call OraStmt.Cancel explicitly, the function gets stuck directly at cancels. The Stored Procedure is very extensive. It consists from cursors and Object type.
      Can one help me at this problem?

      Many thanks in advance!

      Benedikt Taube

      Important data:

      Development environment:     VB6
      OO4O:                     10.2.0.2.20
      Oracle Client:               10.2.0.1.0
      Oracle Net:               10.2.0.1.0
      Oracle-DB:                10.2

      Function (...)
      Set colCrefos = Nothing
      Set colKapitel = Nothing
      Set colEntscheider = Nothing
      lngRetCode = 0

      objConnection.DB.Parameters.Add "RET", ORACLE_KO, ORAPARM_OUTPUT, ORATYPE_NUMBER
      ...
      objConnection.DB.Parameters.Add "CREFOS", Null, ORAPARM_OUTPUT, ORATYPE_VARRAY, (SCHEMAOWNER & ".CCRF_ORGANISATIONS")
      objConnection.DB.Parameters.Add "KAPITEL", Null, ORAPARM_OUTPUT, ORATYPE_VARRAY, (SCHEMAOWNER & ".CCRF_KAPITELS")
      objConnection.DB.Parameters.Add "ENTSCHEIDER", Null, ORAPARM_OUTPUT, ORATYPE_VARRAY, (SCHEMAOWNER & ".CCRF_ENTSCHEIDERS")

      objConnection.DB.Parameters("NAME").Value = objTools.String2Varchar(strName)
      ...
      objConnection.DB.Parameters("HAUSNUMMER").Value = objTools.String2Varchar(strHausnummer)

      Set OraStmt = objConnection.DB.CreateSql("Begin :RET := " & SCHEMAOWNER & ".CRF_SUCHE.ANSCHRIFT( :RETCODE, :NAME, :RECHTSFORM, :PLZ, :ORT, :STRASSE, :HAUSNUMMER, :CREFOS, :KAPITEL, :ENTSCHEIDER); end;", ORASQL_NONBLK)

      On Error GoTo err_asynchron

      Dim stat As Long
      stat = OraStmt.NonBlockingState

      While (stat = ORASQL_STILL_EXECUTING And Me.Cancel = False) 'ORASQL_SUCCESS
      DoEvents
      stat = OraStmt.NonBlockingState
      Wend
      err_asynchron:
      err.Clear

      On Error GoTo Anschrift_Err

      'OraStmt.Close
      'Set OraStmt = Nothing

      If Me.Cancel = True Then
      ...
      Anschrift = True
      Else
      lngRetCode = objConnection.DB.Parameters("RETCODE").Value
      If lngRetCode = ORACLE_KO Then
      Call err.Raise(objConnection.DB.LastServerErr, sFnc, objConnection.DB.LastServerErrText)
      End If
      Anschrift = IIf(objConnection.DB.Parameters("RET").Value = ORACLE_OK, True, False)
      If Anschrift = True Then
      Set colCrefos = objConnection.DB.Parameters("CREFOS").Value
      Set colKapitel = objConnection.DB.Parameters("KAPITEL").Value
      Set colEntscheider = objConnection.DB.Parameters("ENTSCHEIDER").Value
      End If
      End If
      Anschrift_Ex:
      For i = 1 To objConnection.DB.Parameters.Count
      objConnection.DB.Parameters.Remove 0
      Next i
      Exit Function
      Anschrift_Err:
      ...
      Resume Anschrift_Ex
      End Function