G
Guest
Howdy All
I'm writing some VBA code to update a table from a flatfile that was downloaded off the net. Any record in the flatfile may have a primary key that already exists in the table, in which case I think I need to use an SQL "UPDATE" statement to modify the table. Another record, however, may have a primary key value that is entirely new, in which case I think I need to use an SQL "INSERT INTO" statement to update the table. This process of testing to see if a key already exists, then picking between an INSERT INTO versus an UPDATE must be very commonplace. Is there a simplier way to go about the task?
I'm writing some VBA code to update a table from a flatfile that was downloaded off the net. Any record in the flatfile may have a primary key that already exists in the table, in which case I think I need to use an SQL "UPDATE" statement to modify the table. Another record, however, may have a primary key value that is entirely new, in which case I think I need to use an SQL "INSERT INTO" statement to update the table. This process of testing to see if a key already exists, then picking between an INSERT INTO versus an UPDATE must be very commonplace. Is there a simplier way to go about the task?