Click here to Skip to main content
15,889,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dBase requires a "PACK" command be sent after the "DELETE" command.

Is there a way to use ADO Recordset and to delete records from a dBase table ?

(I am useing C# Language and ODBC Connection String.)
PLS SEE MY CODE

C#
Thanks.
Posted
Updated 17-Dec-14 23:11pm
v3

I believe the command text is incorrect. you need to connect to the Dbase file using a DSN and use that
DSN with the ODBC connection object to execute delete and pack commands on the table. Also, You need to specify the Table Name with the delete command like :

Delete * from Tablename where fac_code = '123whatever'
 
Share this answer
 
Do not post the same question on several forums: ODBC to dBase with deleted row[^]
Please, try to understand what they want to tell you. The referenced article is quite clear and contains few helpful links. Read it again: http://geekswithblogs.net/THines01/archive/2010/03/23/packdbf.aspx[^]
The most important is: the DBF driver does not ACTUALLY delete records from the data source -- it only marks them for deletion, so there is a need to use pack command.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900