RecordCount > 4 vb6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prigupta2
    New Member
    • Oct 2008
    • 33

    RecordCount > 4 vb6.0

    Hello Friends,
    vb6.0
    i want to add only 4-record in the table IF record is greater then or equal then 4 then i want to show message and
    Main_frm.Login_ mnu.Enabled = False

    code i use:

    Set pk = OpenDatabase(Ap p.Path & "\NewCount.mdb" , False, False)
    Set r = pk.OpenRecordse t("Count", dbOpenDynaset)
    If r.RecordCount > 4 Then
    Main_frm.Login_ mnu.Enabled = False
    Else
    Main_frm.Login_ mnu.Enabled = True
    End If

    but it is not working
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    what do you mean by add only 4-record in the table


    if you are adding records to database tables then why you need to use recordcount property of recordset object ?

    Comment

    • prigupta2
      New Member
      • Oct 2008
      • 33

      #3
      Originally posted by debasisdas
      what do you mean by add only 4-record in the table


      if you are adding records to database tables then why you need to use recordcount property of recordset object ?
      NewCount.mdb => Count (Table) => Record (Field)

      i want to add only 4 record in Record field

      Dim r As Recordset
      Set r = pk.OpenRecordse t("Count", dbOpenDynaset)
      r.AddNew
      r.Fields("Recor d") = 1
      r.Update
      r.close
      ??????????????? ????????
      if Record(field ) row is greater then or equal to 4 then record can't be add
      please send relative codes as quick as

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        before inserting new records you need to check for the count of records in the database tables and then proceed further.

        Comment

        Working...