Results 1 to 6 of 6

Thread: [RESOLVED] Replicating a record issue

  1. #1

    Thread Starter
    Addicted Member Quizton's Avatar
    Join Date
    Dec 2005
    Location
    VB Forums
    Posts
    209

    Resolved [RESOLVED] Replicating a record issue

    ,

    Im using vb6 and have a problem reguarding replicating the same record,
    ATM it will allow me to replicate records in the db and I wish to not allow this
    and display a message "Employee already Entered" Or "ID already In Use"?
    here is my add and function add code
    vbcode___________________________
    Private Sub cmdAdd_Click()
    txtFirstName.Text = vbNullString
    txtLastName.Text = vbNullString

    list

    End Function

    Thanks again
    Last edited by Quizton; Dec 29th, 2005 at 06:02 PM.

  2. #2
    Junior Member
    Join Date
    Dec 2005
    Location
    Surat,India
    Posts
    29

    Re: Replicating a record issue

    hi

    Before rs.addnew you have to search in the table that is id exist in table or not ?
    if exist then give message else add new record

    Or u can define primary key in table and do error handling in front end
    Or u can also do it in procedures
    Virendrasinh Narendrasinh Mahida
    ----------------------------------
    There is Never a WRONG time to do the RIGHT Thing

  3. #3

    Thread Starter
    Addicted Member Quizton's Avatar
    Join Date
    Dec 2005
    Location
    VB Forums
    Posts
    209

    Re: Replicating a record issue

    still not quite right?
    anymore sugg?

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Replicating a record issue

    You should use a Primary Key, a unique identification for all your records so they wouldn't be duplicated...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Addicted Member Quizton's Avatar
    Join Date
    Dec 2005
    Location
    VB Forums
    Posts
    209

    Re: Replicating a record issue

    Thanks again Dee-u for all the help!

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: [RESOLVED] Replicating a record issue

    No worries.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

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



Click Here to Expand Forum to Full Width