PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 21 → More detail in resetting database
More detail in resetting database
Débuté par Mike Stewart, 07 fév. 2017 18:47 - 4 réponses
//hostimage.webdev.info/avatars/default.gif
Posté le 07 février 2017 - 18:47
I am trying to delete all of the data from my database as part of a security feature.

I tried looping through an array of filenames and using hdeleteall but not all of the physical files had been created yet because of some of them needing password protection.

However, I was unable to deal with the errors when the files could not be found.

This I solved by creating the file using hcreationifnotfound to create the files.

However......

I am still having problems as they are certain files which hdeleteall is not working. I have tried opening and or closing the file before hand. I have tried hdelete... but the one line of data is still there.

Please help... this is driving me crazy
//hostimage.webdev.info/avatars/default.gif
Posté le 07 février 2017 - 21:32
Hi Mike,

as I was saying before, a simple loop on hCreation will do the trick
(it will create/force the file EMPTY)

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 2/7/2017 à 12:47 PM, Mike Stewart a écrit :
I am trying to delete all of the data from my database as part of a
security feature.

I tried looping through an array of filenames and using hdeleteall but
not all of the physical files had been created yet because of some of
them needing password protection.

However, I was unable to deal with the errors when the files could not
be found.

This I solved by creating the file using hcreationifnotfound to create
the files.

However......

I am still having problems as they are certain files which hdeleteall is
not working. I have tried opening and or closing the file before hand.
I have tried hdelete... but the one line of data is still there.

Please help... this is driving me crazy
//hostimage.webdev.info/avatars/default.gif
Posté le 07 février 2017 - 22:35
OK... so hcreation works where hdeleteall doesn't

No idea why but thanks Fabrice
//hostimage.webdev.info/avatars/RrpZpplIAjR9ZZaAh1xcw
Membre enregistré
2 553 messages
Popularité : +89 (91 votes)
Posté le 08 février 2017 - 03:21
Hello mike

Contact me by skype adrianoboller

I will help you

:thank you:

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
//hostimage.webdev.info/avatars/default.gif
Posté le 08 février 2017 - 13:17
Hi


Le 2/7/2017 à 4:35 PM, Mike Stewart a écrit :
OK... so hcreation works where hdeleteall doesn't

No idea why but thanks Fabrice


It's simple: They are not doing the same thing.

hdeleteall delete ALL RECORDS inside the file. For that, the file NEEDS
TO EXIST, and that was your problem.

hCreation creates the file empty (if it's already there it's overwritten
empty). So this works if your file exist or not (and i('s much faster too).

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com