I have a program that will load a database file but the data only will be inserted in a new table. My question is how to check if the database file is the same as inserted in the database how to reject it and just give a message "data exists".
My plan is to create a if exists query but it seems it doesn't work or my code doesn't work. by the way the table doesn't have an id /primary key.
"IF EXISTS(SELECT COUNT(*) FROM TABLE1) " & vbCrLf &
"BEGIN" & vbCrLf &
"SELECT * FROM TABLE1" & vbCrLf &
"END" & vbCrLf &
"ELSE" & vbCrLf &
"BEGIN" & vbCrLf &
"INSERT INTO TABLE1 SELECT * FROM TABLE1_TEMP" & vbCrLf &
"END"