Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retaining deleted records
Message
De
26/08/1997 08:02:30
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, États-Unis
 
 
À
26/08/1997 07:45:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00046880
Message ID:
00046887
Vues:
23
>In a VFP 5.0 medical app, I need to move deleted records to an archive file, before I pack (for chain of custody legal reasons). Does any one have some sample code on how to simply do this. SHould I put some kind of UI on it, or just do it behind the scenes when the file is packed?
>
>Thanks in advance.

I'd do it behind the scenes...
LOCAL lcTmp1, lnDelRec, lnTArchive, lcTmpDir
lcTmp1 = SUBSTR(SYS(2015), 3, 10)
lcTmpDir = "C:\TEMP\"

SELECT MainTable
USE
USE MainTable EXCLUSIVE
COUNT FOR DELETED() TO lnDelRec

SELECT * FROM MainTable WHERE DELETED() INTO DBF (lcTmpDir+lcTmp1)
SELECT 0
USE (lcTmpDir+lcTmp1) ALIAS ac_Temp
IF RECCOUNT('ac_Temp') = lnDelRec
  USE ArchTable
  APPEND FROM (lcTmpDir+lcTmp1)
  SELECT MainTable
  PACK
ELSE
  =MESSAGEBOX("Archive Count MisMatch")
ENDIF
HTH
Matt McDonnell
...building a better mousetrap with moldy cheese...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform