Rich Shepard wrote:
  What is the most efficient approach to test whether a record has a value
in a field that's different from the one displayed? The only approach that
occurs to me is to retrieve each field from the table and compare values
with those in the form when the "Save" button is clicked. If the field is
blank, then use an 'insert' statement; if the field has an existing value,
use an 'update' statement. Seems kludgy to me.

Kludgy but works.

Another method is to have a field declared UNIQUE and use the syntax:

 INSERT OR REPLACE INTO table ...

The UNIQUE constraint will trigger the REPLACE constraint if it already exists and the row will get updated instead of inserted.

--
Craig Morrison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
http://pse.2cah.com
  Controlling pseudoephedrine purchases.

http://www.mtsprofessional.com/
  A Win32 email server that works for You.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to