0 Replies Latest reply on Nov 20, 2002 4:02 PM by 25224

    OIP-04122 Bind variable not full enabled error message

    25224
      I am trying to use VB for Applications to open an OraSesion in Excel.
      I am using Oracle 8.0.5 and OO4O 2.3
      When executing the following script I get a run time error message. "OIP-04122 Bind variable not full enabled error message". Debug points to this line as the culprit.
      OraDatabase.Parameters.Add "upper_lmt", "1", ORAPARM_INPUT

      Does the error occur because the OO40 version 2.3 does not support bind variables. Or does the fault lie elseware.
      thanks, James

      Sub var_parms()
      Dim OraSession As Object
      Dim OraDatabase As Object
      Dim OraDynaset As Object
      Dim flds() As Object
      Dim fldcount As Integer

      Set OraSession = CreateObject("OracleInProcServer.XOraSession")
      Set OraDatabase = OraSession.OpenDatabase("", "scott/tiger", ORADYN_DEFAULT)

      OraDatabase.Parameters.Add "upper_lmt", "1", ORAPARM_INPUT
      OraDatabase.Parameters("upper_lmt").ServerType = ORATYPE_NUMBER

      Set OraDynaset = OraDatabase.CreateDynaset _
      ("SELECT * FROM au_week_number WHERE week_num = :upper_lmt", ORADYN_DEFAULT)

      fldcount = OraDynaset.fields.Count
      ReDim flds(0 To fldcount - 1)
      For Colnum = 0 To fldcount - 1
      Set flds(Colnum) = OraDynaset.fields(Colnum)
      Next

      For Colnum = 0 To OraDynaset.fields.Count - 1
      ActiveSheet.Cells(1, Colnum + 1) = flds(Colnum).Name
      Next

      For Rownum = 2 To OraDynaset.RecordCount + 1
      For Colnum = 0 To fldcount - 1
      ActiveSheet.Cells(Rownum, Colnum + 1) = flds(Colnum).Value
      Next
      OraDynaset.DbMoveNext
      Next
      Range("A1:A1").Select
      End Sub