Created
October 9, 2020 13:25
-
-
Save reuniware/6e547cf7e55355a2db552145840964e6 to your computer and use it in GitHub Desktop.
Windev Mobile 25 : Création table SQLite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gbFichierExiste est un booleen = faux | |
SI fFichierExiste(fRepExe() + "\databases\scanned.db") ALORS | |
gbFichierExiste = vrai | |
Info("fichier existe") | |
FIN | |
ScannedDb est une Connexion | |
ScannedDb..Provider = hAccèsNatifSQLite | |
ScannedDb..Source = "scanned.db" | |
ScannedDb..Accès = hOLectureEcriture | |
SI HOuvreConnexion(ScannedDb) = Faux ALORS | |
Erreur(HErreurInfo()) | |
sinon | |
SI gbFichierExiste = Faux ALORS | |
SI HExécuteRequêteSQL(ScannedDb, "ScannedDb", hRequêteDéfaut, "CREATE TABLE article(code TEXT, quantite REAL);") = Vrai ALORS | |
Info("Création table ok.") | |
SINON | |
Info("Erreur création : " + HErreurInfo()) | |
FIN | |
SINON | |
SI HExécuteRequêteSQL(ScannedDb, "ScannedDb", hRequêteDéfaut, "INSERT INTO article VALUES('0123456789', 1.5);") = Vrai ALORS | |
Info("Insertion ok.") | |
SINON | |
Info("Insertion erreur : " + HErreurInfo()) | |
FIN | |
FIN | |
SI HExécuteRequêteSQL(ScannedDb, "ScannedDb", hRequêteDéfaut, "SELECT * FROM article") = Vrai ALORS | |
Info("Obtention ok.") | |
// ICI COMMENT LIRE ???? | |
SINON | |
Info("Obtention erreur : " + HErreurInfo()) | |
FIN | |
HFermeConnexion(ScannedDb) | |
FIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment