Preparing to Update Views
Before you can update data in a view, the view properties that control updates must be set so that the view can be updated. In most cases, the default view property values are set so that the view can be updated.
The following table lists the view properties that control updates and their default settings for views.
View property | Default setting |
---|---|
Tables |
Includes all tables that have updateable fields and have at least one primary key field. |
KeyField |
Database key fields and remote primary keys on the table. |
UpdateName |
Table_name.column_name for all fields. |
Updateable |
Update all fields except primary key fields. |
SendUpdates |
Defaults to the session default, which is originally set to False (.F.). If you change it to True (.T.), that becomes the default for all views created in the session. Note While all the properties in the table are required for updating data, the SendUpdates view property controls whether to send updates. You must set SendUpdates to True (.T.) to send updates to the data source. Tip As you develop your application, you might want to set SendUpdates to False (.F) so that you can set other view properties without updating data. When you are ready to test your application, set the SendUpdates property to True (.T.) to begin updating data. |
CompareMemo |
Defaults to True (.T.), means that memo fields are included in the WHERE clause and are used for detecting update conflicts. |
Note
The default view property settings might not enable updates for a view that is created programmatically. To enable updates for programmatically created views, review the default settings for the view properties and adjust them as needed. To change the settings for view properties, use the DBSETPROP( ) function. For more information, see DBSETPROP( ) Function.
Note
By default, optimistic row buffering is used for views. However, you can change this to table buffering. For more information, see How to: Perform Updates Using Buffers.
See Also
Tasks
Other Resources
Updating Data in Views
Managing Views
Working with Views (Visual FoxPro)