PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Transactions and Reindexing
[WD20] Transactions and Reindexing
Iniciado por guest, 12,jul. 2016 16:26 - 3 respuestas
Publicado el 12,julio 2016 - 16:26
http://doc.windev.com/en-US/…

I am testing WinDev's version of transactions. In the documentation from the link above and below the header, Tip: restoring the integrity of the database, I see "Note: After a power outage, we recommend that you reindex the data files of the application."

How can I reindex all the files via code? All I see is HIndex() and it only seems to work on one file at a time.
Publicado el 12,julio 2016 - 18:28
Hi Curtis,

via HListFile() you can get a list of analysis files.
You can execute HIndex() for each found file in a loop.
Publicado el 12,julio 2016 - 19:06
Hi Curtis,
If you are using HF C/S and the power outage is on a workstation (and NOT on the server), there is NO NEED to reindex the files.

Steven Sitas
Publicado el 12,julio 2016 - 20:36
Thanks!

I am using client/server. If the power outage occurs on the workstation then HTransactionInterrupted will still equal true, correct? So in my project initialization code below I just need to figure out how to only call ReindexFiles() if it was the server that crashed. Am I understanding this right?

EDIT: Also, using HListFile shows a compilation error with my current configuration. The error is, "The project is using native accesses, which is not available in integrated framework."

// Check database integrity in case of power failure, reboot, etc... IF HTransactionInterrupted() = True THEN IF Confirm("The transaction performed by computer " + H.TrsPost + " was interrupted. " + ... "Do you want to restore the consistency of data files?") = True THEN // Cancels the interrupted transactions IF HTransactionCancel() = False THEN Error("Unable to cancel the transaction.") END ReindexFiles() END END