Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to prevent duplicate file in Access db?

how to prevent duplicate file in Access db?

Scheduled Pinned Locked Moved C#
databasequestionsalestutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nidhelp
    wrote on last edited by
    #1

    hi how do i make sure that user cannot create New Customer Profile if there's already one in Access database? thanks

    E 1 Reply Last reply
    0
    • N nidhelp

      hi how do i make sure that user cannot create New Customer Profile if there's already one in Access database? thanks

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      hi there, That depends on which field(property) need to be checked for duplicate. Assume that each customer has his id and the id must be unique in whole system. So that before creating a new customer, ur application will validate the id if it's already existed or not. << >>

      N 1 Reply Last reply
      0
      • E enjoycrack

        hi there, That depends on which field(property) need to be checked for duplicate. Assume that each customer has his id and the id must be unique in whole system. So that before creating a new customer, ur application will validate the id if it's already existed or not. << >>

        N Offline
        N Offline
        nidhelp
        wrote on last edited by
        #3

        yes, yes.. that's what i want to do (to check if that id is already in my database) how do i do that? also, how to check for repeated data just based on three particular fields though i've other fields in that row... that means if 1 or 2 of the particular fields are repeated data, it's not considered as duplicates. but if all three of the particular fields have repeated data, it IS duplicate and how can i prevent that?? lastly, how to check for repeated data if based on all fields on a row?? meaning, all fields are the same then it's considered duplicate. thank you for your time! =)

        E 1 Reply Last reply
        0
        • N nidhelp

          yes, yes.. that's what i want to do (to check if that id is already in my database) how do i do that? also, how to check for repeated data just based on three particular fields though i've other fields in that row... that means if 1 or 2 of the particular fields are repeated data, it's not considered as duplicates. but if all three of the particular fields have repeated data, it IS duplicate and how can i prevent that?? lastly, how to check for repeated data if based on all fields on a row?? meaning, all fields are the same then it's considered duplicate. thank you for your time! =)

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          hi there, ur question can be devided into 3 parts: nidhelp wrote: check if that id is already in my database => to validate: just execute "select id from customer where id= m_sID". If the returned result is not NULL, that means it's duplicated nidhelp wrote: if all three of the particular fields have repeated data => the similar thing u need to do: "select id from customer where field1 = field1Val and field2 = field2Val and field3=field3Val" nidhelp wrote: if based on all fields on a row =>similar to the second one with all fields need to be verified in WHERE clause Happy programming << >>

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups