From: alexander s. <al...@go...> - 2012-05-25 09:32:36
|
On 25.05.2012 11:58, Mohan Sindhe wrote: > > I am using the dbfpy2.2.5 on windows system with python 2.6.7. > In dbfpy how to delete a record. I have used the below code but no use. > > /* > > db = dbf.Dbf("test.dbf") > rec = db[0] > rec.delete() > rec.store() > del rec > db.close() > > */ > > After this when i Open the test.dbf file its not showing the deleted > record, but when i read it using pydbf its printing the deleted record. > > /* > > db = dbf.Dbf("test.dbf") > # should be 3 records, printing 4 > print 'count elements: ', len(db) > > */ Should be 4. The record is still in the file, and that is the way how DBF works. If you want to purge deleted records, you have to copy all records that are not deleted to a new file. Cheers, alex. |