View Full Version : insert new record with not duplicate record

03-23-2006, 03:06 PM
i want to insert new record which is will not duplicate with the previous record.
if the record duplicate, the error message will appear.how can i do it??

03-23-2006, 03:45 PM
Unless you have your database fields setup with a UNIQUE flag then you can do a select first and check against it.


username = "john"

SELECT from table where field = username

if NOT rs.EOF then
error - name already exists
INSERT INTO field values (username)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum