Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    insert new record with not duplicate record

    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??

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Unless you have your database fields setup with a UNIQUE flag then you can do a select first and check against it.

    e.g.

    username = "john"

    SELECT from table where field = username

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •