sqlite & mySQl hassles...

Admin admin at mfelkerco.com
Thu Aug 25 21:35:12 EDT 2011


  

Dixie, 

Here is one of my queries from a working Live Code
program: 

 put "SELECT UserName,Password FROM UserValidation where
UserID = " &SQ &CurUserID &SQ into theQuery2
 put
revDataFromQuery(,,dbID,theQuery2) into theData2

theData2 is the stored
data for that SELECT, which in this case, is a username and password
where the userID = the current one (when they logged in - done on a
previous card and carried over as a global variable (CurUserID)

I
noticed you said it worked in the IDE but not the sim - the sim for
what? IOS? Android?

You will note that the file paths are critical in
this case - if it's wrong, your program will not work right or at
all.

For example, you have:

set the defaultfolder to
specialFolderPath("documents")

However, you may have to change it to
read:

set the defaultfolder to specialFolderPath("..documents")

or
something along those lines.

Mike

On Fri, 26 Aug 2011 01:20:38 +0100,
John Dixon wrote: 

> Pete...
> The MySQL script that works... but just
not on a real device...
> /* get the data from the database */
> get
revOpenDatabase("mysql","www.xxxxxx.com
[14]","xxxxxxxx","xxxxxxx","xxxxxxx")
> put it into gDatabaseRef
> 
>
get revDataFromQuery( tab, return, gDatabaseRef, "SELECT
Name,GPSPosition FROM towns;")
> revCloseDataBase gDatabaseRef
> put
empty into gDatabaseRef
> 
> set itemDel to tab
> sort lines of it by
item 1 of each
> put it into theData
> The sqlLite script... works in
the IDE but not in the simulator...
> /* get the data from the database
*/
> set the defaultfolder to specialFolderPath("documents")
> put
revOpenDatabase("sqlite","localKnow.db",,,,) into gDataBaseRef
> get
revDataFromQuery (tab, return , gDataBaseRef, "SELECT * FROM towns" )
>
put it into theData
> 
> revCloseDataBase gDatabaseRef
> take
care,Dixie
> 
>> Date: Thu, 25 Aug 2011 16:38:05 -0700 Subject: Re:
sqlite & mySQl hassles... From: pete at mollysrevenge.com [8] To:
use-livecode at lists.runrev.com [9] Hi John, Could you publish one of the
queries that is causing the problem? That might give a clue. Pete
Molly's Revenge On Thu, Aug 25, 2011 at 3:31 PM, John Dixon wrote: 
>>

>>> Mike... Thank you for the reply... the scripts for getting the data
from the mySQL database work in the IDE and in the iphone simulator,
they will not work on a real device. The app just crashes... the sqlite
scripts also run in the IDE and return the requested data, though they
do not wish to run in the iphone simulator returning the error
"revdberr,Database Error: no such table: towns"... However, if I query
the database, using "SELECT name FROM sqlite_master WHERE type='table'
ORDER BY name;" it tells me that the table towns exixsts... so, I think
that misspelling is not the culprit here... Dixie 
>>> 
>>>> Date: Wed,
24 Aug 2011 15:02:37 -0400 Subject: Re: sqlite & mySQl hassles... From:
admin at mfelkerco.com [1] To: use-livecode at lists.runrev.com [2] Look for a
misspellings or accidental caps or something - SQL is telling
>>> you no
such table exists. I have encountered this before and making sure your
naming conventions are 100% will most certainly help. 
>>> 
>>>> Mike
John Dixon wrote: 
>>>> 
>>>>> Hi...Has anyone got mySQL or sqlite
databases working on iOS ?I have a
>>> mySQL database that runs well in
the iphone simulator, but crashes on a real device... No problem, I
thought... I'll make a sqlite database and run it from within the
app...The sqlite database runs fine on the desktop, but in the simulator
throws an error... "revdberr,Database Error: no such table: towns"... I
am a little stumped and confused...If anyone has databases playing
nicely, I would appreciate some pointers to how you have gone about
getting it to work ... as I would really like to find out why the mySQL
db runs in the simulator but falls over on an iphone... and err, why it
tells me the table is not present in the sqlite db..thanksDixie
http://lists.runrev.com/mailman/listinfo/use-livecode [6]
_______________________________________________ use-livecode mailing
list e> subscription preferences: 
>>>> 
>>>>>
http://lists.runrev.com/mailman/listinfo/use-livecode [4]
>>>>
_______________________________________________ use-livecode mailing
list use-livecode at lists.runrev.com [5] Please visit this url to
subscribe
>>> and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode [7]
>>> 
>>>> 
>>
_______________________________________________ use-livecode mailing
list use-livecode at lists.runrev.com [12] Please visit this url to
subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode [13]
> 
>
_______________________________________________
> use-livecode mailing
list
> use-livecode at lists.runrev.com [15]
> Please visit this url to
subscribe, unsubscribe and manage your subscription preferences:
>
http://lists.runrev.com/mailman/listinfo/use-livecode [16]

 


Links:
------
[1] mailto:admin at mfelkerco.com
[2]
mailto:use-livecode at lists.runrev.com
[3]
mailto:dixonja at hotmail.co.uk
[4]
http://lists.runrev.com/mailman/listinfo/use-livecode
[5]
mailto:use-livecode at lists.runrev.com
[6]
http://lists.runrev.com/mailman/listinfo/use-livecode
[7]
http://lists.runrev.com/mailman/listinfo/use-livecode
[8]
mailto:pete at mollysrevenge.com
[9]
mailto:use-livecode at lists.runrev.com
[10]
http://www.mollysrevenge.com
[11] mailto:dixonja at hotmail.co.uk
[12]
mailto:use-livecode at lists.runrev.com
[13]
http://lists.runrev.com/mailman/listinfo/use-livecode
[14]
http://www.xxxxxx.com
[15] mailto:use-livecode at lists.runrev.com
[16]
http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the Use-livecode mailing list