2009. augusztus 25., kedd

Detecting database changes


Problem/Question/Abstract:

Detecting database changes

Answer:

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.

Nincsenek megjegyzések:

Megjegyzés küldése