Kannan_SJD
Kannan_SJD

Reputation: 1062

"Multiple- Step operation generated errors. check each status value." error in VB6 Application

when I try to insert a value to recordset in the 'Description' field. it showing a error like

runtime error '-2147217887(80040e21)' Multiple- Step operation generated errors. check each status value.

sql = "SELECT * FROM vePODetail WHERE vePOID=" & Str(ado_veReceive.Recordset("vePOID")) & " ORDER BY vePODetailID"
rs.ActiveConnection = g_cnnCompany
rs.Open sql
   Do While Not rs.EOF
    ado_veReceiveDetailWF.Recordset.AddNew
    ado_veReceiveDetailWF.Recordset("vePODetailID") = rs("vePODetailID")
    ado_veReceiveDetailWF.Recordset("prMasterID") = rs("prMasterID")
    ado_veReceiveDetailWF.Recordset("Description") = rs("Description")
    ado_veReceiveDetailWF.Recordset("QuantityReceived") = rs("QuantityOrdered") -rs("QuantityReceived")
    ado_veReceiveDetailWF.Recordset.Update
    rs.MoveNext
    Loop
    rs.Close 

the field in the recordset acccepts only 50 char.

Please tell how to increase the size/length of the field in the recordset.

Upvotes: 0

Views: 18431

Answers (2)

squillman
squillman

Reputation: 13641

Assuming you're using SQL Server, you can change your query using a CAST operation:

sql = "SELECT vePODetailID,prMasterID,CAST(Description as VARCHAR(100)) AS Description, QuantityReceived FROM vePODetail WHERE vePOID=" & Str(ado_veReceive.Recordset("vePOID")) & " ORDER BY vePODetailID"

That should set the length of the Description field in the recordset to 100 characters. You can do this in other db platforms as well, but the syntax may be different for the CAST.

Upvotes: 0

George
George

Reputation: 2213

If the field is 50 chars long, you must change the DB's definition of the field from 50 to whatever you need. You cannot do that through a recordset

Upvotes: 3

Related Questions