Modifying Data
Go Up to Understanding Datasets Index
You can use the following dataset methods to insert, update, and delete data if the read-only CanModify property is True. CanModify is True unless the dataset is unidirectional, the database underlying the dataset does not permit read and write privileges, or some other factor intervenes. (Intervening factors include the ReadOnly property on some datasets or the RequestLive property on TQuery components.)
Dataset methods for inserting, updating, and deleting data:
Method | Description |
---|---|
Edit |
Puts the dataset into dsEdit state if it is not already in dsEdit or dsInsert states. |
Append |
Posts any pending data, moves current record to the end of the dataset, and puts the dataset in dsInsert state. |
Insert |
Posts any pending data, and puts the dataset in dsInsert state. |
Post |
Attempts to post the new or altered record to the database. If successful, the dataset is put in dsBrowse state; if unsuccessful, the dataset remains in its current state. |
Cancel |
Cancels the current operation and puts the dataset in dsBrowse state. |
Delete |
Deletes the current record and puts the dataset in dsBrowse state. |
The following topics discuss these methods in greater detail:
- Editing Records
- Adding New Records
- Deleting Records
- Posting Data
- Canceling Changes
- Modifying Entire Records