Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Value_Assign triggers Redundant Write to Table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00619831
Message ID:
00619988
Views:
15
Hi Vlad

I found this in VFP 7.0 SP1. I have no code in the refesh method. I only added the Value_Assign method to a standard combobox. I then put the grid and the combobox on the form bound to the same table. So when I move down the grid with the arrow keys the combobox displays the value from the field to which it is bound. If I start a second instance of VFP and lock a record in the table to which the grid is bound I will get an error when I try to display that record in the grid. The error is trigger by the Value_Assign method on the line This.Value=eNewVal.

I can send you a sample.

Thanks
Simon



>Hi!
>
>What version of VFP you use??? I ried this in VFP6 and Value_Assign is NOT fired during refreshing no matter what I do. It seems during refreshing you have some program that assign value to teh Value property. Just pu Set Step On (breakpoint) in the Value_Assign method code and check in Call Stack debugger window where from this method is called and how.
>
>>Hi
>>
>>In the Value_Assign method of a data bound control the line:
>>
>>
>>This.Value=eNewVal
>>
>>
>>triggers a write to the table which makes sense when you change the value. However when bound to a table field, it also triggers a write to the table when the control is refreshed with new data from a table. So you have the odd situation where the control is refreshing itself with new data from a table and that triggers a redundant write back to the table even though no data has been changed.
>>
>>Lets assume we have a grid and a combobox on a form. The combobox is bound to a field in the same table that the grid is bound to. Let's assume for some reason that the combobox has a Value_Assign method. Every time you move to a new record in the grid and refresh the combobox the Value_Assign triggers a write back to the table.
>>
>>Is this the designed behaviour? It would have been nice if the Value_Assign was still accessed in the above secnario but the redundant write back to the file did not occur. In my opinion for what ever it is worth is that the write back to the table should occur everytime the value is changed but not when the value is just being read from the table.
>>
>>Simon White
Simon White
dCipher Computing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform