Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

need help : Error (row cannot be located for updating)

$
0
0
I am getting error (Row cannot be located for updating)

Database : MySQL DB

Here's my code

Code:

Dim rs As ADODB.Recordset
Dim sqlCriteria As String
Dim i As Long

   
    sqlCriteria = "SELECT * FROM sql_Dependents WHERE sNumber='" & eMasterCode & "'"

    Set rs = New ADODB.Recordset
        rs.CursorLocation = adUseClient
        rs.CursorType = adOpenForwardOnly
        rs.LockType = adLockOptimistic
       
        rs.Open sqlCriteria, cn
       
       
            For i = 0 To 10 - 1
                With grid_Dependents
               
                    rs.Find ("cNumber = '" & grid_Dependents.CellText(i, 0) & "'")

                If Not rs.EOF Then
                    rs!eName = .CellText(i, 1)
                    rs!eRelation = .CellText(i, 2)
                    rs!eAGE = .CellText(i, 3)
                    rs!eOccupation = .CellText(i, 4)
                End If
               
                rs.Update
                End With
            Next i
           

           
    MsgBox "Record updated!", vbInformation, "Updated"

    Set rs = Nothing

I need your help guys.

Thanks in advance.

Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>