Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the value of a field in BeforeUpdate of CA
Message
From
23/09/2004 16:04:58
 
 
To
23/09/2004 06:42:26
Eyvind W. Axelsen
Profdoc Norge As
Oslo, Norway
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00945286
Message ID:
00945503
Views:
33
>
>Thank you for your insight, I was able to find a solution using BeforeCursorUpdate. Don't you find it a bit odd, though, that changes done in BeforeUpdate are respected if the data source is "ADO", but not when it is "Native"?
>

Hi Eyvind,

If Agnes is correct and the field you are trying to modify hasn't been marked as modified before, the auto-generated command doesn't include the field because the command is generated before the BeforeUpdate event is called. I am sure, you would see the same result for ODBC and even ADO data source type if CursorAdapter were configured to send updates through ADODB.Command object. However, when CursorAdapter is configured to send updates through ADODB.Recordset, the command is not generated. In this case, after the BeforeUpdate event, CursorAdapter goes through modified fields and simply puts their values into the recordset, that is why your changes are picked up. To achieve the same result with other scenarios, you may try to change cUpdateInsertCmd parameter of the BeforeUpdate event or change UpdateType for the CursorAdapter, which has its own side-effects. Moving logic to the BeforeCursorUpdate event might be not what you really want because it is called only when TABLEUPDATE is called explicitly, it is called once per TABLEUPDATE call not once per record, it is called regardless of what type of changes you have buffered Updates/Inserts/Deletes or whether there are changes at all.

Thanks,
Aleksey.
Previous
Reply
Map
View

Click here to load this message in the networking platform