Searching Date filed, numeric field & text field simulteneously

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • umeshkakade
    New Member
    • Dec 2006
    • 3

    Searching Date filed, numeric field & text field simulteneously

    I have used mdb with 4 fields - rollno, name, date & attendance.
    I have design a form for data entry by considering above fields.
    I have connected it to DAO database object.

    Suppose I have saved data with following values
    roll = 1 & date = 15/12/2006
    now, I want to write code which avoid duplicate entry i.e user could’nt save record with same values ie roll = 1 & date = 15/12/2006.
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Originally posted by umeshkakade
    I have used mdb with 4 fields - rollno, name, date & attendance.
    I have design a form for data entry by considering above fields.
    I have connected it to DAO database object.

    Suppose I have saved data with following values
    roll = 1 & date = 15/12/2006
    now, I want to write code which avoid duplicate entry i.e user could’nt save record with same values ie roll = 1 & date = 15/12/2006.
    Hi there,

    TO be able to do that you need to make sure that data integrity is properly set, i.e. primary & foreign key. Have you set those keys yet? Kindly refer to below attached link for further reading & understanding, hope it helps. Good luck & Take care.

    Data Integrity

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by sashi
      TO be able to do that you need to make sure that data integrity is properly set, i.e. primary & foreign key.
      Hi umeshkakade.

      What sashi says is true, but keep in mind that the database does not have to enforce these sort of rules. You can also do it in your code. This is obviously a less reliable way of going about it, but can still work.

      Also, try looking up "unique" keys. Although Primary and Foreign keys are very important, it's the uniqueness which is the critical aspect in your case.

      Comment

      Working...