Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter and Buffering
Message
From
18/05/2017 20:05:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01651194
Message ID:
01651206
Views:
59
>Hi,
>
>1. I created a CA object.
>2. Created a cursor with the exactly the same structure as the CA cursor. Call it 'new' cursor
>3. Detached the 'original' cursor from CA.
>4. Updated the 'new' cursor created in step 2 above (in code). For example, replace field_abc with '123'
>5. Attached the 'new' cursor created in step 2 to the CA object. Checked that the cursor still have the value set in code (field field_abc '123').
>6. Executed TableUpdate(.t.). No error. But the SQL table didn't get updated.
>
>My understanding of the problem is that CA relies on Buffering (optimistic, 3). So when I attached a 'new' cursor to the CA, the TableUpdate() does not "see" any changes. So it does not update anything.
>
>I need to figure how to "force" the CA to update the underlying table. I did try setting the SendUpdates to .T. but to no avail.
>
>Any suggestions?
>
>UPDATE: The bottom line is that unless the changes to the cursor done WHILE IT IS ATTACHED, the TableUpdate(.T.) will not update the base table. The changes made to the cursor WHILE IT IS DETACHED are not sent to the DB when TableUpdate(.T.). If anybody knows how to get around it, I would greatly appreciate it.

SetFldState() should do the trick:
https://msdn.microsoft.com/en-us/library/aa978317(v=vs.71).aspx
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform