Antwort auf: SQLite Datenbank speichert nicht

Startseite Foren Deutsches LiveCode-Forum SQLite Datenbank speichert nicht Antwort auf: SQLite Datenbank speichert nicht

#14368
Klaus Major
Administrator

    HI Herby,

    kleiner Logikfehler:

    ...
       if the environment is "mobile" then
          ## Das passiert automatisch auf der mobilen Platform
          ## set the fullscreen of this stack to true
          set the fullscreenmode of me to "exactFit"
          
          ## Wenn Du später mal anfängst, Deinen Code zu DEBUGgen,
          ## wirst Du diese Technik zu schätzen wissen: Variablen kosten nix
          ## daher ist es ratsam, welche zu erstellen, um später deren Inhalt im Debugger 
          ## überprüfen zu können. Selbst wenn es momentan nicht nötig ist.
          put specialFolderPath("resources") & "/Medizin.db" into tQuellDB
          put specialFolderPath("documents") & "/Medizin.db" tZielDB
          
          ## Das machst Du bei JEDEM Programmstart!
          ## Bitte mal auf der Zunge zergehen lassen... 8-)
          ## put url ("binfile:" & specialFolderPath("resources") & "/Medizin.db") into url ("binfile:" & specialFolderPath("documents") & "/Medizin.db")
          
          ## Das sollte aber nur EINMAL beim allerersten Programmstart passieren, daher:
          if there is NOT a file tZielDB then
             put url("binfile:" & tQuellDB) into url("binfile:" & tZielDB)
          end if
          put tZielDB into xpfd
       else
          
          ## Auch in der IDE funktionieren specialfolderpath() Codes:
          ## put the filename of this stack into xpfd
          ## set the itemDelimiter to "/"
          ## delete the last item of xpfd
          ## put xpfd &"/Medizin.db" into xpfd
          
          ## "resources" zeigt in der IDE auf den Ordner in dem sich der aktuelle Stack befindet:
          put specialfolderpath("resources") & "/Medizin.db" into xpfd
       end if
    ...

    Gruß

    Klaus