Using the documents folder in Android
Posted: Sat Dec 31, 2011 12:29 am
I have been trying to get this to work and hopefully someone can advise where I am going wrong...
At the install settings on Android device I am trying to locate the SQLite database in the documents folder in Android so that I can open it.. apparently you can't open databases in the engine folder.
Following advice from various postings I found this is what I have done so far.
At the setting page see I have added the database file and set the Copy Referenced File to: specialFolderpath("documents") this is exactly what I entered so if this is incorrect syntax please let me now...
Also the code that then opens the database file that should have been installed in the correct location is:
The database file is connecting but not the file I loaded but to a file created at runtime as not found.
Any help would be really appreciated as this has got me stumped. It is probably something basic again...
Regards
Jason
At the install settings on Android device I am trying to locate the SQLite database in the documents folder in Android so that I can open it.. apparently you can't open databases in the engine folder.
Following advice from various postings I found this is what I have done so far.
At the setting page see I have added the database file and set the Copy Referenced File to: specialFolderpath("documents") this is exactly what I entered so if this is incorrect syntax please let me now...
Also the code that then opens the database file that should have been installed in the correct location is:
Code: Select all
if the environment is "mobile" then
put specialFolderPath("documents") & "/fujserv.db" into pathNdb
else
set the itemDelimiter to "/"
put item 1 to -2 of the effective filename of this stack into pathNdb
put pathNdb & "/fujserv.db" into pathNdb
end if
## Open a connection to the database
put revOpenDatabase("sqlite", pathNdb, , , , ) into conID
answer "Connected to: " & pathNdb & return & " conID is: " & conID
Any help would be really appreciated as this has got me stumped. It is probably something basic again...

Regards
Jason