View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 10:30 AM
Kevin
 
Posts: n/a
Default UPDATE or INSERT or both

I have a simple table

BoatTripID (int) (autoincrement) (key)
TripTypeID (int)
TripDate (date)

An html form sends me the data that I am going to put into a query. It
will send me the TripTypeID and the TripDate. The data might already
be in the table, or it might have been changed by the form. It also
may already be in the database as a certain trip type, but the user
wants to cancel the trip and delete the record.

Is there a quick way to check for the existence of a record, make
changes if necessary, leave the record unchanged if unchanged, and
delete if necessary? I could do it with lots of queries and code, but
I was wondering if there is some simpler way of doing this.
Reply With Quote