FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
Resetting database
Resetting database
Débuté par Mike Stewart, 06 fév. 2017 20:57 - 3 réponses
Connectez-vous…
Mike Stewart
#1
Posté le 06 février 2017 - 20:57
I am trying to reset my database as a security element of my app.
I can't get the following code to work because I can not get the errors to 'fall silently'
Can anyone suggest what may be wrong or suggest an alternative please? if fFileexist for example doesn't work on Android
Many Thanks
Procedure
Scrub_data
(
)
s
Ps
is string
=
AtSchool
(
"N"
)
s
PassReq
is string
=
"Individuals Foc_reg_log"
s
NoPass
is string
=
"school_detail group_hierarchy group_membership groups Foc_reg_header seating_plans timetable_entries TT_clashes Lesson_Files"
s
NoPass
=
s
NoPass
+
" Lesson_outline lessons day_timings Entities OneDrive WorkHierarchy current_user"
serr
is string
FOR
EACH STRING
s
File OF
s
PassReq SEPARATED
by
" "
IF
HOpen
(
s
File
,
s
Ps
)
=
True
THEN
s
SQL
is string
=
"DELETE FROM "
+
s
File
dsOne
is Data Source
IF
HExecuteSQLQuery
(
dsOne
,
hQueryDefault
,
s
SQL
) =
False
THEN
//
IF HDeleteAll(sFile)=False THEN
serr
=
serr
+
CR
+
HErrorInfo
(
hErrMessage
)
END
ELSE
Trace
(
HErrorInfo
(
hErrFile
)
)
END
END
FOR
EACH STRING
s
File OF
s
NoPass SEPARATED
by
" "
s
SQL
is string
=
"DELETE FROM "
+
s
File
dsOne
is Data Source
IF
HExecuteSQLQuery
(
dsOne
,
hQueryDefault
,
s
SQL
) =
False
THEN
//
IF HDeleteAll(sFile)=False THEN
serr
=
serr
+
CR
+
HErrorInfo
(
hErrMessage
)
END
END
//info(serr)
OpenMobileWindow
(
WIN_login
)
Signaler
0
0
Fabrice Harari
#2
Posté le 07 février 2017 - 10:41
Hi Mike
you are talking about errors, but you are not giving us the error
message, or on what instruction it happened
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/6/2017 à 2:57 PM, Mike Stewart a écrit :
I am trying to reset my database as a security element of my app.
I can't get the following code to work because I can not get the errors
to 'fall silently'
Can anyone suggest what may be wrong or suggest an alternative please?
if fFileexist for example doesn't work on Android
Many Thanks
PROCEDURE Scrub_data
(
)
sPs
is
string
=
AtSchool
(
"N"
)
sPassReq
is
string
=
"Individuals Foc_reg_log"
sNoPass
is
string
=
"school_detail group_hierarchy group_membership
groups Foc_reg_header seating_plans timetable_entries TT_clashes
Lesson_Files"
sNoPass
=
sNoPass
+
" Lesson_outline lessons day_timings
Entities OneDrive WorkHierarchy current_user"
serr
is
string
FOR EACH STRING
sFile
OF
sPassReq
SEPARATED BY
" "
IF HOpen
(
sFile
,
sPs
)
=
True THEN
sSQL
is
string
=
"DELETE FROM "
+
sFile
dsOne
is
Data Source
IF HExecuteSQLQuery
(
dsOne
,
hQueryDefault
,
sSQL
) =
False THEN
// IF HDeleteAll(sFile)=False THEN
serr
=
serr
+
CR
+
HErrorInfo
(
hErrMessage
)
END
ELSE Trace
(
HErrorInfo
(
hErrFile
)
)
END
END
FOR EACH STRING
sFile
OF
sNoPass
SEPARATED BY
" "
sSQL
is
string
=
"DELETE FROM "
+
sFile
dsOne
is
Data Source
IF HExecuteSQLQuery
(
dsOne
,
hQueryDefault
,
sSQL
) =
False THEN
// IF HDeleteAll(sFile)=False THEN
serr
=
serr
+
CR
+
HErrorInfo
(
hErrMessage
)
END
END
//info(serr)
OpenMobileWindow
(
WIN_login
)
Signaler
0
0
Mike Stewart
#3
Posté le 07 février 2017 - 12:16
In this case I could not get the error handling to work even when I tried the automated version. What did work though was to create the file if it did not exist using hcreationifnotfound. That way I avoided the errors in the first place.
If anyone would like to add anything to this I am pretty sure it is a function that will be needed.
Signaler
0
0
Fabrice Harari
#4
Posté le 07 février 2017 - 15:47
Hi Mike,
If anyone would like to add anything to this I am pretty sure it is a
function that will be needed.
Needed for what? If you uninstall the apk, all data files are deleted too...
So except if you have a very specific case file, I don't know whre
anybody would use this.
Furthermore, a simple loop on hcreation will reset all files.
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
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte