Huge problem updating FoxPro with ADO recordset
I am trying to update a Visual FoxPro table with an ADO recordset object. When I change the value of a field in one of the rows, however, the fields is changed in ALL of the rows after the update is complete. Here is sample code:
Dim con As New ADODB.Connection
Dim rs As ADODB.Recordset
con.Open "Driver={Microsoft Visual FoxPro Driver}; SourceType=DBF; SourceDB=c:\db; Exclusive=No;"
rs.Open "select * from items where ponumber = 111", con, adOpenForwardOnly, adLockOptimistic
rs!quantity = 42
rs.Update
rs.Close
set rs = Nothing
If the select returned two rows, both rows will have a quantity of 42. When I do the same thing with MS SQL Server, it only updates the first row.
I'd really appreciate any help!
- Eric
|