>Hi,
>
>Were updating SQL7 database records from VFP tables using ADO recordsets but were getting the following error message when updating the second field:
>OLE IDispatch exception code 0 from Microsoft Cursor Engine: Multiple-step operation generated errors. Check each status value...
>
>
>We use the following piece of code:
>
>oConnection = Createobject("ADODB.Connection")
>oConnection.Open("SQLTEST","UserName","PassWord")
>
>oRecordSet = CREATEOBJECT("ADODB.RecordSet")
>WITH oRecordset
> .Cursorlocation= 3
> .CursorType = 3
> .LockType = 3
> .Open("mytable", oConnection)
> .MarshalOptions = 0
>
> SELECT MyTable
> lnFldCnt = FCOUNT()
>
> SCAN
> .AddNew()
> FOR lnF = 1 TO lnFldCnt
> .Fields(FIELD(lnF)).Value = EVAL(FIELD(lnF))
> ?.Fields(FIELD(lnF)).Value
> ENDFOR
> .Update()
> ENDSCAN
>ENDWITH
>
>
>Any help is greatly appreciated.
>
>TIA,
>Arriyel
It probably has to do with the data that you are trying to put into a field. Verify that the recordset field can hold the value in that second vfp field and that the types are compatible. Also note that the fields collection is zero based so you might need to reference (lnF - 1) to access the equivalent field in the recordset.
Also after the error (possibly in the debug window) check the value of the State property for the field that gave the error, something like .Fields(lnF).State. (or lnF - 1) HTH