Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP to SQL7 update error
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
VFP to SQL7 update error
Miscellaneous
Thread ID:
00614779
Message ID:
00614779
Views:
55
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
Speak using soft and sweet words in case you have to eat them later.
Next
Reply
Map
View

Click here to load this message in the networking platform