FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Mass undelete records in a DBF-file - SOLVED
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Mass undelete records in a DBF-file - SOLVED
Posted: Thu Mar 14, 2013 02:29 PM

A customer of mine deleted a few thousand records in a DBF-file.

They are still there of course but they are all marked as deleted.

How can I undelete all those records?

Thank you very much in advance for any help.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Mass undelete records in a DBF-file
Posted: Thu Mar 14, 2013 02:36 PM
You have to use the RECALL command...

http://www.ousob.com/ng/53guide/ngd675b.php

EDITED: You have to test it, because I only see this documentation on Harbour:

http://www.fivetechsoft.com/harbour-docs/api.html#dbrecall

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Mass undelete records in a DBF-file
Posted: Thu Mar 14, 2013 03:02 PM
Before you try anything, make sure you make a copy of the affected database...

If I understand correctly, dbRecall() recalls only the record where the pointer is at...

So you probably can try:

DBEVAL()

Performs a code block operation on the current Database

Syntax
DBEVAL( <bBlock>,
[<bFor>], [<bWhile>],
[<nNext>], [<nRecord>],
[<lRest>] ) --> NIL
Arguments
<bBlock> Operation that is to be performed

<bFor> Code block for the For condition

<bWhile> Code block for the WHILE condition

<nNext> Number of NEXT records to process

<nRecord> Record number to work on exactly

<lRest> Toggle to rewind record pointer
Returns
DBEVAL() always returns NIL

Description
Performs a code block operation on the current Database


I never had the need to recover any records, but you can start from there...
Please post your results, so we can learn from it...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Mass undelete records in a DBF-file
Posted: Thu Mar 14, 2013 03:45 PM
Bayron wrote:If I understand correctly, dbRecall() recalls only the record where the pointer is at...


No:

Code (fw): Select all Collapse
RECALL FOR condition


EMG
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Mass undelete records in a DBF-file - SOLVED
Posted: Thu Mar 14, 2013 03:54 PM

Thanks a lot, guys.

Your help was all very helpful.

It was the first time I had to do that. And thanks to you all with succes.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: Mass undelete records in a DBF-file - SOLVED
Posted: Thu Mar 14, 2013 04:06 PM

Michel

All the indexes have to be rebuild , or when the dbf is packed the index should be active

Frank

test
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Mass undelete records in a DBF-file - SOLVED
Posted: Thu Mar 14, 2013 04:09 PM

I am glad you succeeded...
Anyone's problems is a school for all of us...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Continue the discussion