Multiple-step generated error.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neo008
    New Member
    • Jun 2007
    • 85

    #1

    Multiple-step generated error.

    Hi all,

    Finally gave up and putting it here.

    I am new to visual basic stucked up with an error-

    Run time errors.'-2147217887 (8004021)': Multiple-step operation generated errors. check each status value.

    Error comes at ADODC.RECORDSET .UPDATE command.


    Because of multi column listbox's limitations I'm using 3 istboxes which temporarily save items to be sold and at last get updated into database on a command button click event.
    Also I am using some temporary variables and textboxes to store data because Addnew command clears the fields.

    Interesting things
    1. It saves successfully for first two attempts and at third time it shows me above error.
    2. Even if the conditions are satisfied for FOR loop it gets out of the loop after a run.


    here is detail

    [CODE=vb]
    If NoSale = True Then
    Exit Sub
    Else
    'SHOWS A DIALOG SETS THE VALUE OF DebitCredit.Tex t
    DialogDbCr.Show
    If DebitCredit.Tex t = "" Then
    Exit Sub
    Else

    If DebitCredit.Tex t = "CREDIT" Then
    OtherCash.Text = "CREDIT"
    'IF SALE IS ON CREDIT NO NEED OF CASH DETAIL
    Else
    If DebitCredit.Tex t = "DEBIT" Then DialogCash.Show
    'DialogCash SETS THE DETAIL OF CASH INTO OtherCash.Text
    End If

    If OtherCash.Text = "" Then
    Exit Sub
    Else
    'SOME TEMP VARIABLES AND TEXT BOXES ARE STORING VALUES
    CashOther = OtherCash.Text
    DebCre = DebitCredit.Tex t
    'TempState.Text = OtherMP.Text
    TempDate.Text = SDate.Text
    Dis = Val(DiscountGiv en.Text)
    tx = Val(Tax.Text)

    'TIME TO UPDATE
    ' LCount IS LISTCOUNT (NUMBER OF LIST ITEMS)
    For i = 0 To i = LCount - 1
    SaleData.Refres h '''''''''''''AD ODC.REFRESH
    SaleData.Record set.AddNew

    'RESTORING DATA TO DATA BOUND CONTROLS FROM TEMP VARIABLES 'AND TEXT BOXES

    'HID_Sale AND CID_Sale ARE TEXTBOXES
    HID_Sale = Val(HCompanyID. Text)
    CID_Sale = Val(CustomerID. Text) '''''
    OtherMP.Text = TempState.Text
    SDate.Text = TempDate.Text

    'OtherCash AND DebitCredit ARE TEXTBOXES
    'CashOther and DebCre ARE VARIABLES AS STRING
    OtherCash = CashOther
    DebitCredit = DebCre

    ' Tax AND DiscountGiven ARE TEXT BOXES
    'Dis AND tx ARE VARIABLE AS DOUBLE
    DiscountGiven = Dis '
    Tax = tx

    'TEXT BOXES RESTORING DATA FROM LIST BOXES
    PID_Sale = Val(ProIDList.L ist(i))
    Quantity = Val(QuaList.Lis t(i)) '''''
    SPrice = Val(RateList.Li st(i))

    TotalAmount = Val((Val(Val(Va l(SPrice.Text) * Val(Quantity.Te xt)) * Val(Tax.Text)) / 100) + Val(Val(SPrice. Text) * Val(Quantity.Te xt)) - Val(Val((Val(Va l(Quantity.Text ) * Val(SPrice.Text )) * Val(DiscountGiv en.Text))) / 100))


    SaleData.Record set.Update ' ERRORRRRRRRRRR
    'SaleData.Refre sh

    Next i

    MsgBox "Sold"
    SaleData.Refres h
    Call Clear
    Call EnableSale
    Call EnableControls

    ProIDList.Clear
    QuaList.Clear
    RateList.Clear
    [/CODE]


    Please point out my mistakes and help me.

    NE☼
  • neo008
    New Member
    • Jun 2007
    • 85

    #2
    Hi again,

    Well I think it's simple for you experts because I might have done mistakes in syntax also.

    First possibility is that I have done mistakes in data transfer between temporary storage.

    Second possibility of this error may be data type mismatch with database.

    Third - data limit of any data type is exceeding.


    Could somebody please help me? I'm using VB6 and MS-ACCESS

    NE☼

    Comment

    • ansumansahu
      New Member
      • Mar 2007
      • 149

      #3
      Originally posted by neo008
      Hi again,

      Well I think it's simple for you experts because I might have done mistakes in syntax also.

      First possibility is that I have done mistakes in data transfer between temporary storage.

      Second possibility of this error may be data type mismatch with database.

      Third - data limit of any data type is exceeding.


      Could somebody please help me? I'm using VB6 and MS-ACCESS

      NE☼
      Hi ,

      Have a look at this site which talks about the "'Multiple-step OLE DB' error". Hope this helps you out.

      good luck
      -ansuman sahu

      Comment

      • neo008
        New Member
        • Jun 2007
        • 85

        #4
        Originally posted by ansumansahu
        Hi ,

        Have a look at this site which talks about the "'Multiple-step OLE DB' error". Hope this helps you out.

        good luck
        -ansuman sahu
        Hi Ansumansahu,

        I went through the given link and i think that is a description of any other but somewhat same error. It is true that there may be some datatype mismatch as i lready stated in 2nd post. I can say this because I had searched about the problem on net before posting here.

        And what all possibilities I found I have described in Ist and 2nd posts.

        Since I have elaborated my problem very much it seems like a big one but I think if somebody can check datatype mismatch or data limit exeeding in above code could catch the cause of error.

        Comment

        • neo008
          New Member
          • Jun 2007
          • 85

          #5
          Any Idea any suggession please.

          NE☼

          Comment

          Working...