|
-
Nov 7th, 2000, 02:02 PM
#1
Thread Starter
Junior Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|