Detecting database changes (Views: 100)


Detecting database changes


Do you need to determine if a user has changed any of the fields of a displayed record, but hasn't yet posted the record? If so, you can check the current state of the database via the datasource associated with it. To do so, simply write the following code:

if (Datasource1.State in dsEditModes) then
  {...code you want to execute...}

If the datasource's State property is dsEdit, dsInsert or dsSetKey, this statement will evaluate as true.

<< Back to main page