How can I just move thought a recordset and update records which meet my criteria, it updates the whole file.

This is what I am doing.




Dim cn1 As ADODB.Connection
Dim rs1 As ADODB.Recordset

Set cn1 = New ADODB.Connection
cn1.ConnectionString = "Provider=MSDASQL.1;" _
& "Persist Security Info=False;" _
& "DSN=Visual FoxPro Tables;" _
& "UID=;" _
& "PWD=;" _
& "SourceDB=c:\ado;" _
& "SourceType=DBF;" _
& "Exclusive=No;" _
& "BackgroundFetch=Yes;" _
& "Collate=Machine;" _
& "Null=Yes;" _
& "Deleted=Yes;"

If cn1.State = 1 Then
cn1.Close
Else
cn1.Open
End If
cn1.CursorLocation = adUseClient

Set rs1 = New ADODB.Recordset
rs1.Open "SELECT * FROM test", cn1, adOpenKeyset, adLockOptimistic

For x = 1 To rs1.RecordCount
With rs1
!Name = "I know"
.MoveNext
End With
Next x

rs1.Close
cn1.Close