Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP to SQL7 update error
Message
From
04/02/2002 23:21:59
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00614779
Message ID:
00615232
Views:
18
>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			&& Use Client
>   .CursorType = 3			&& Open Static
>   .LockType = 3  			&& Lock Optimistic
>   .Open("mytable", oConnection)	&& SQL table (target)
>   .MarshalOptions = 0			&& Marshal All
>
>   SELECT MyTable   			&& VFP table (source)
>   lnFldCnt = FCOUNT()
>
>   SCAN
>      .AddNew()
>      FOR lnF = 1 TO lnFldCnt
>         .Fields(FIELD(lnF)).Value = EVAL(FIELD(lnF))  && it fails here when lnF > 1
>         ?.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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform