Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update conflict
Message
From
05/01/2001 06:46:48
 
 
To
05/01/2001 03:28:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00459687
Message ID:
00459713
Views:
17
Hi!

When you move record pointer, data from view automaticallu updated to base table. When you return back, view contains empty record that is already updated. So What? the problem is in the ID key. Views work using identifications of record in table. For new records ID key usually generated in the table. When record was updated, ID key in the table changed, but it still empty in the view. When you try to edit such record and than update, update conflict occurrs, just because record ID in view is different compare to the record ID in the table. After requery view (as you said, after close it and open again), new record contains valid ID field value, so now view ID and table ID are in synch - no conflict.

To fix this problem, you require to generate new ID key value in the view and save it immediately. In the view designer you can change properties of each field of view, include default value. You require also to save ID field to table (by default it is not saved), to do that check ID field to send it in update together with otehr fields in view designer.

HTH.

>I have a parameter updateable local view.
>
>The error appear when
>
>1.append a new record
>2.move the record pointer
>3.and then back the new record
>4.edit it...
>5.then system prompt me that update conflict.
>
>I need to close the view and open it again to edit the new appended record.
>
>Why... how to solve this... :(
>
>TIA.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform