Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error: 2072 - cursor cannot be modified because it ...
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01183834
Message ID:
01183839
Views:
40
>Hello,
>
>I was wondering if anybody had come across error 2072 whilst working with table cursors.
>
>I have a small grid of around 1 to 100 records that displays a single field (one of several) alongside an editbox that displays the contents of the selected record's memo field.
>
>The cursor displaying the contents is one that I have created with a CREATE CURSOR statement and then populated with an INSERT INTO ... SELECT FROM statement.
>
>The first thing I do when the interface starts is select the top record within the grid and then try to enter text into the edit box. Every timje I do this results in the undocumented error number 2072:
>
>"cursor cannot be modified because it contains an unsaved record"
>
>Suspending the error displays my applications READ EVENTS in the debugger; ignoring the error shuts my application down, returning to the VFP session that I have called it from.
>
>If suspend the error and resume the error may be called again by further attenpts to enter text into the edit box. If I continue to move the record pointer up and down the grid the error may or may not occur when I attempt to enter text into the edit box.
>
>If I suspend the error and browse the cursor separately and edit the memo field directly, the error disappears.
>
>I also receive the error if I fire a
REPLACE MyMemo WITH "Test" IN MyCursor
but not after moving the record pointer up and down for a while.
>
>It is worth noting that I am not using any specific buffering or data environment settings other than the default. I did try a CURSORSETPROP - SendUpdate but this will not work on table cursors.
>
>Has anybody else come across similar behavior and can anybody advise a way to stop this from happening?
>
>Many thanks in advance for any help anyone can provide.
>
>Regards,

You must have RowBuffering for your cursor, that is why when you move record pointr up or down you didn't get that error. Usually that error occurs when you try to refresh a buffered table (cursor, View, CA) and you didn't choose what you must do with changed records in current record set. So befere requery the View or CA use:
TableRevert(.t., [MyCursor]) && Or TableUpdate(1, .t., [MyCursor]) if you want to save changed records
REQUERY([MyCursor]) && or CAObject.CursorRefresh()
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform