how can I write a small database program, that can be used by several computers?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OBA
    New Member
    • Feb 2008
    • 3

    how can I write a small database program, that can be used by several computers?

    I am new to vb6, but I was trying to find how can I write a small database program, that can be used by several computers in 1 location (for example: Office), the problem i encounter is that if the two user press or add at same time the records might duplicate. Also, is there is any networking code that I have to add?
    Thank you,
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    To avoid duplicate entry make the field primary key and check for existance of record before inserting the same into database.

    Comment

    • werks
      New Member
      • Dec 2007
      • 218

      #3
      Originally posted by OBA
      I am new to vb6, but I was trying to find how can I write a small database program, that can be used by several computers in 1 location (for example: Office), the problem i encounter is that if the two user press or add at same time the records might duplicate. Also, is there is any networking code that I have to add?
      Thank you,
      If in case that they click at the same time before adding/saving it try to Validate the record first..


      -Kenneth
      --"Better Than Yesterday"

      Comment

      • OBA
        New Member
        • Feb 2008
        • 3

        #4
        Originally posted by werks
        If in case that they click at the same time before adding/saving it try to Validate the record first..


        -Kenneth
        --"Better Than Yesterday"
        tnx for your help i have created on how to validate the primary key first before save to database i also got it in the net..but there is instances that duplicate the records

        Private Sub checkid()
        Dim rsuserlist As New ADODB.Recordset
        existusername = False
        rsuserlist.Open "select * from tblinfo where idnum=" & Val(Text1.Text) , cn, adOpenKeyset, adLockPessimist ic
        If rsuserlist.Reco rdCount > 0 Then
        existusername = True
        End If

        rsuserlist.Clos e
        Set rsuserlist = Nothing
        End Sub

        Comment

        • werks
          New Member
          • Dec 2007
          • 218

          #5
          Your welcome ^^


          --
          Kenneth
          "Better Than Yesterday"

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Its better to use

            rsuserlist.Open "select count(*) from tblinfo where idnum=" & Val(trim(Text1. Text)), cn, adOpenKeyset, adLockPessimist ic

            for better performance.

            Comment

            Working...