M
MyndPhlyp
I'm using Access 2000 and going after the tables with ADO. The FoxPro tables
are accessed through ODBC (Microsoft Visual FoxPro Driver v6.01.8630.01)
using database type "Visual FoxPro database (.DBC)" with the Null and
Deleted driver options unchecked. If I can trust the comments in the
Database Properties in Visual FoxPro, the database is vintage 3.50 SP1.
I can .AddNew/.Update to my heart's content, but I can't seem to
..Delete/.Update records.
A typical scenario would be:
Dim rs As New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "mytable", conLocal, adOpenDynamic, adLockPessimistic,
adCmdTableDirect
rs.Filter = "mystring = '12345'"
Do Until rs.EOF
rs.Delete
rs.Update
rs.MoveNext
Loop
Pretty straightforward stuff, but if I go back and look at the table through
either Access or FoxPro, the records are still there. (And, in FoxPro, none
of the records are flagged as deleted.)
It gets better ...
Successive runs of the same code fall apart on the .Delete because the
record is flagged for deletion (even though the ODBC driver has been
configured to not deliver deleted records and the adLockPessimistic
supposedly puts me into "immediate mode"). So I end up wrapping the .Delete
and .Update with:
If rs.Status Then
rs.Delete
rs.Update
End If
rs.MoveNext
What's the trick to really deleting records in a linked FoxPro table using
ADO in Access 2000? And when the records /*are*/ finally deleted, do I still
have to go back to FoxPro somewhere along the line and do a PACK on the
table(s)?
are accessed through ODBC (Microsoft Visual FoxPro Driver v6.01.8630.01)
using database type "Visual FoxPro database (.DBC)" with the Null and
Deleted driver options unchecked. If I can trust the comments in the
Database Properties in Visual FoxPro, the database is vintage 3.50 SP1.
I can .AddNew/.Update to my heart's content, but I can't seem to
..Delete/.Update records.
A typical scenario would be:
Dim rs As New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "mytable", conLocal, adOpenDynamic, adLockPessimistic,
adCmdTableDirect
rs.Filter = "mystring = '12345'"
Do Until rs.EOF
rs.Delete
rs.Update
rs.MoveNext
Loop
Pretty straightforward stuff, but if I go back and look at the table through
either Access or FoxPro, the records are still there. (And, in FoxPro, none
of the records are flagged as deleted.)
It gets better ...
Successive runs of the same code fall apart on the .Delete because the
record is flagged for deletion (even though the ODBC driver has been
configured to not deliver deleted records and the adLockPessimistic
supposedly puts me into "immediate mode"). So I end up wrapping the .Delete
and .Update with:
If rs.Status Then
rs.Delete
rs.Update
End If
rs.MoveNext
What's the trick to really deleting records in a linked FoxPro table using
ADO in Access 2000? And when the records /*are*/ finally deleted, do I still
have to go back to FoxPro somewhere along the line and do a PACK on the
table(s)?