VB6 Runrime error Could not Update currently locked

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesnkk
    New Member
    • Nov 2006
    • 134

    VB6 Runrime error Could not Update currently locked

    Hi, I am using ADO, sometime I got an error message Could not update currently lock, and sometime I don;t . Error stop in last sentence "Rsumm.Upda te" , Before exit the program I have use rsumm.close and
    set rsumm = Nothing

    I am lost could someone advise me.


    Set rs = New Recordset
    rs.LockType = adLockPessimist ic
    rs.CursorType = adOpenDynamic
    rs.CursorLocati on = adUseClient
    rs.ActiveConnec tion = conn
    rs.Open "Select * from Process where SN = '" & txtSN & "'", conn

    Set rsSumm = New Recordset
    rsSumm.LockType = adLockPessimist ic
    rsSumm.CursorTy pe = adOpenDynamic
    rsSumm.CursorLo cation = adUseClient
    rsSumm.ActiveCo nnection = conn
    rsSumm.Open "Select * from Summary where SN = '" & txtSN.Text & "'", conn






    If Option3 = True Then
    rs("Failurecode ") = txtFailure
    rs("Measure1") = txtComponent
    rs("Repair1") = txtComponent
    rs("Repair1By" ) = UserID
    rs("Repair1Date ") = Now()
    rs("Measure1Dat e") = Now()
    rs("Measure1By" ) = UserID
    rs("NextProcess 1") = "Debug2"
    rs.update
    rsSumm("Process ") = "Debug2"
    rsSumm("Status" ) = "WIP"
    rsSumm("Current Debug") = 1
    rsSumm.update
    End If
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    is it such that multiple users are trying to execute some DML on the same database table ?

    Comment

    • jamesnkk
      New Member
      • Nov 2006
      • 134

      #3
      Originally posted by debasisdas
      is it such that multiple users are trying to execute some DML on the same database table ?
      No, I am the only one using , it just pure ms access database

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        is there any relationship between both the recordsets ?

        Try to use rs.addnew or rs.edit before using rs.update .

        Comment

        • jamesnkk
          New Member
          • Nov 2006
          • 134

          #5
          Originally posted by debasisdas
          is there any relationship between both the recordsets ?

          Try to use rs.addnew or rs.edit before using rs.update .
          No relationship, It only show rs.editmode no rs.edit, could you explain a bit more ? I cannot rs.edit it display method or data not found.

          Comment

          Working...