accessing database table on iPad

Peter Haworth pete at lcsql.com
Tue Sep 16 23:54:39 EDT 2014


Sounds like the path to your db is wrong. LC happily creates an empty file
for you which is not even formatted as an sqlite db! I've always thought
that was flat out wrong.

I would check that your db  file exists before calling revdatabaseopen with
the exists() function.

Pete
lcSQL Software
On Sep 16, 2014 6:27 PM, "Frantz Charles" <fzcharles0214 at hotmail.com> wrote:

> To all,
> I need your expertise help to solve this issue I encounter in the app I am
> creating. Here is the problem:I create a SQLite database with 2 tables
> containing data. The database is saved in the same folder than the app. I
> can access with ease the database and read the records from my desktop. But
> when I test the app with the emulator or with my iPad, even though a
> database id is returned - proof that the database is open - I got the
> following error: revdberr, Database Error: No such table Histoire" .  Here
> are my codes.Here are the codes to open the database:# Open the databaseput
> "/users/frantzcharles/Documents/All About
> LiveCode/Cric-Crac/CricCracDB.sqlite" into thePathput "/CricCracDB.sqlite"
> into theMobilePathif the environment = "mobile" then     if there is not a
> file (specialFolderPath("Documents") & theMobilePath) then        put
> (specialFolderPath("engine") & theMobilePath) into sPath        put url
> ("binfile:" & sPath) into dPath        put dPath into url ("binfile:" &
> (specialFolderPath("Documents") & theMobilePath))     end if  put
> (specialFolderPath("Documents") & "/CricCracDB.sqlite") into tDBPath  put
> revOpenDatabase("sqlite", tDBPath ,,,,,,) into tConIDelse  ## this is not
> mobile  put revOpenDatabase("sqlite", thePath ,,,,,,) into tConIDend ifHere
> are the codes to access the tableput "Select Hist_Question from Histoire
> where Hist_Id = " & tNextQ into tSQL put revdb_querylist(,,g_ConID, tSQL)
> into tList
> I am missing something. Which I can not put my finger on. Can any of you
> help me? Thanks a lot
> Frantz
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list