sqlite & mySQl hassles...

Pete pete at mollysrevenge.com
Thu Aug 25 22:53:38 EDT 2011


I don't see anything wrong with the SQL so I'm thinking this may be a folder
path issue.  One of the weird things about SQL (or maybe it's
revOpenDatabase, not sure) is if you try to open a database file that
doesn't exist, the file gets created as an empty file and no error is
returned so you think all is fine but really it isn't.  I always check if
the file exists with "if there is a file" statement with exactly the same
path information as passed to revOpenDatabase before calling revOpenDatabase
to make sure I'm looking in the right folder.  It looks like you're setting
the paths correctly but since I'm not familiar with the mobile simulators or
the devices, there may be some quirks with them.  I would add some displays
of the fully qualified db file name to you code just to make sure you are
looking in the right place.
Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Thu, Aug 25, 2011 at 5:20 PM, John Dixon <dixonja at hotmail.co.uk> 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
> ","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
> > To: use-livecode at lists.runrev.com
> >
> > Hi John,
> > Could you publish one of the queries that is causing the problem?  That
> > might give a clue.
> > Pete
> > Molly's Revenge <http://www.mollysrevenge.com>
> >
> >
> >
> >
> > On Thu, Aug 25, 2011 at 3:31 PM, John Dixon <dixonja at hotmail.co.uk>
> 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
> > > > To: use-livecode at lists.runrev.com
> > > >
> > > > 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 <dixonja at hotmail.co.uk> 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
> > > > >_______________________________________________
> > > > >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
> > > > _______________________________________________
> > > > 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
> > >
> > > _______________________________________________
> > > 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
> > >
> > >
> > _______________________________________________
> > 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
>
> _______________________________________________
> 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