Results 1 to 15 of 15

Thread: Command - "Multiple-step OLE DB Operation generated errors"

Threaded View

  1. #1

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Command - "Multiple-step OLE DB Operation generated errors"

    I have the following code within a Loop.

    It works perfectly if I write one record at a time, but within the loop (loading multiple records) I get the error:

    "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."

    Why does this work once, but not on the second time through?


    Code:
    strWriteData = "INSERT INTO PROD.CSU_Clinic_Info(ID,Institution,Occurs,Clinic_Date,Location_Num,SID_DOC_NUM," & _
                             "Clinic_Num,Clinic_Code,Doc_Index,Rooms_Used,Time_Of_Day,Cancelled," & _
                             "Cancelled_Reason,Special,Hold,Reassignment,Day_Of_Week,Reinstate,Start_Date,End_Date,User_Name) " & _
                             "VALUES ('" & mUniqueID & _
                             "','" & mInstitution & _
                             "','" & mOccurs & _
                             "'," & "?" & _
                             ",'" & mLocation & _
                             "','" & mSID_DOC_NUM & _
                             "','" & mClinicNum & _
                             "','" & mClinic_Code & _
                             "','" & mDoc_Index & _
                             "','" & mRooms & _
                             "','" & mTime & _
                             "','" & mCancelled & _
                             "','" & mCancelledReason & _
                             "','" & mSpecial & _
                             "','" & mHold & _
                             "','" & mReassignment & _
                             "','" & mDayOfWeek & _
                             "','" & mReinstatement & _
                             "'," & "?" & _
                             "," & "?" & _
                             ",'" & mUserName & "')"
                             
                                                                
                            com.Parameters.Append com.CreateParameter("ClinicDate", adDate, adParamInput, , mClinic_Date)
                            com.Parameters.Append com.CreateParameter("StartDate", adDate, adParamInput, , mStart_Date)
                            com.Parameters.Append com.CreateParameter("EndDate", adDate, adParamInput, , mEnd_Date)
                             
              
           com.CommandText = strWriteData
           com.Execute 'Execute command
    Last edited by The_Grudge; May 31st, 2018 at 01:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width