SQL Yoga error on mobile platform

This is the place to post technical queries about SQL Yoga

Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, trevordevore

Post Reply
dsimpson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 15
Joined: Thu Dec 18, 2008 10:10 pm
Contact:

SQL Yoga error on mobile platform

Post by dsimpson » Sat Aug 30, 2014 10:03 pm

I am trying to use SQL Yoga to connect to an embedded SQLite database with a mobile application, running in the IOS simulator. The stack works fine on the desktop.
It seems like I have the pathname correctly defined, as shown in the PUT statement echoing the pathname I am using to the console.
I get the following error which I don't know how to interpret:

Aug 30 13:33:48 dcsi-MBP15r2.local Application46[70433] <Warning>: [tEnvironment: ]mobile
Aug 30 13:33:48 dcsi-MBP15r2.local Application46[70433] <Warning>: [tDatabaseFile: ]/Users/dsimpson/Library/Application Support/iPhone Simulator/7.1-64/Applications/BB5EA7A3-9545-42A9-931B-0967CB7A77C3/Documents/SQLiteDB.db3
Aug 30 13:33:48 dcsi-MBP15r2.local Application46[70433] <Warning>: 219,4500,17,revOpenDatabase
465,4500,1
587,4411,1
253,4385,1
241,4385,1,dbconn_connect
353,0,0,stack "libSQLYoga" of stack "/Users/dsimpson/Library/Application Support/iPhone Simulator/7.1-64/Applications/BB5EA7A3-9545-42A9-931B-0967CB7A77C3/Application46.app/Application46"
573,161,1,dbconn_connect

The LiveCode Error Lookup Stack shows:
219 Function: error in function handler
465 put: error in expression
587 switch: error in statement
253 if-then: error in statement
241 Handler: error in statement
353 Object Name:
573 Handler: can't find handler

The portion of the code making the connection looks like this:

Code: Select all

        
case "mobile"
               -- copy SQLite file to documents path to allow Read/Write access
               put specialFolderPath("documents") & "/" & tDBName into tDatabaseFile
               put "[tDatabaseFile: ]" & tDatabaseFile
               if there is not a file tDatabaseFile then
                  put specialFolderPath("engine") & "/" & tDBName into tEngineFilePath
                  put URL ("binfile:" & tEngineFilePath) into URL ("binfile:" & tDatabaseFile)
               end if
               break
 ## Tell the Connection object where the database file is
         put "[tDatabaseFile: ]" & tDatabaseFile
         dbconn_set "file", tDatabaseFile
David Simpson
www.fmpromigrator.com

dsimpson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 15
Joined: Thu Dec 18, 2008 10:10 pm
Contact:

Re: SQL Yoga error on mobile platform

Post by dsimpson » Sat Aug 30, 2014 10:14 pm

Never mind...

A few minutes after I posted this message, I noticed that I had forgotten to add SQLite to the standalone settings for IOS.
So I guess we now know what that type of error message looks like. You need to do this on both IOS and Android if SQLite or MySQL is going to be used by the app.
David Simpson
www.fmpromigrator.com

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: SQL Yoga error on mobile platform

Post by trevordevore » Sun Aug 31, 2014 12:03 am

I was just going to suggest that something was different on mobile vs. desktop because revOpenDatabse was failing. I'm glad you already found the solution :-)
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply

Return to “SQL Yoga”