Correct path for sqlite database???

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Correct path for sqlite database???

Post by paulsr » Mon Sep 10, 2012 11:05 am

Greetings:

Plz can someone help me discover what is wrong with the flwg code:

Code: Select all

put specialFolderPath("documents") into g_sfp_docs

put g_sfp_docs & "/airnews/sqlite/newsapp.sqlite" into t_sqlpath  

answer(t_sqlpath)
  
put revOpenDatabase("sqlite",t_sqlpath, , , ) into g_DBid
   
answer("g_DBid="&g_DBid)
I am running it on the iOS simulator. If works fine in any other environment.

The response to the first "answer" statement is:

/Users/paulr/Library/Application Support/iPhone Simulator/5.1/Applications/8202ED65-3120-4DB7-B3D9-953F2CADDAF0/Documents/airnews/sqlite/newsapp.sqlite

That's what I would expect, and newsapp.sqlite is at that location. It is owned by 'paulr' and has perms of 777.

The second "answer" statement is never reached and so produces no output.

I assume therefore there is an error in the "revOpenDatabase" statement, but as I say, it works if the environment is not mobile (and the database is in the expected documents area for that environment).

Have I put the sqlite database in the wrong place for iOS?

TIA...

--paul

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Correct path for sqlite database???

Post by endernafi » Mon Sep 10, 2012 11:13 am

Hi Paul,

Could you try answer without parenthesis'?

Code: Select all

answer t_sqlpath
...
answer "g_DBid = " & gDBid

Regards,

~ Ender Nafi Elekçioğlu
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Correct path for sqlite database???

Post by endernafi » Mon Sep 10, 2012 11:23 am

No, it wasn't that :oops:
But, I've found what's wrong 8)
Please, go to Standalone Application Settings,
and be sure that this little box Sqlite is checked.
Here is an implementation:
http://cloud.keehuna.com/3O2p0Y0B2H3D

Regards,

~ Ender Nafi Elekçioğlu
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: Correct path for sqlite database???

Post by paulsr » Mon Sep 10, 2012 11:36 am

endernafi wrote:No, it wasn't that :oops:
But, I've found what's wrong 8)
Please, go to Standalone Application Settings,
and be sure that this little box Sqlite is checked.
Here is an implementation:
http://cloud.keehuna.com/3O2p0Y0B2H3D

Regards,

~ Ender Nafi Elekçioğlu
Thanks so much for finding the solution. It's been driving me mad all day!

I had no idea the standalone settings were needed for the simulator!

It's early evening here, so I shall crack open a beer to celebrate. :D

Thanks again...

--paul

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Correct path for sqlite database???

Post by endernafi » Mon Sep 10, 2012 11:48 am

Cheers 8)
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Post Reply