SQLite and Android "Database Error:Unable to open the database file"

Ralph DiMola rdimola at evergreeninfo.net
Mon Jun 1 13:30:13 EDT 2015


Thanks Bob!

I can do the same query on various SQLite utilities, IDE Mac and Windows, iOS and it works fine. The same query on Android fails. Only some of the queries fail on Android. Other work fine. I just got the query to work today by deleting data from the DB that wasn't even going to get selected. This is getting to look like a bug. I don't know if it's LC or the SQLite library. I'm going to look at the deleted data and see if it's the data or just the size of the DB. The full DB is only 4mb 1,900 records. If I delete all but the 93 possible records for the query then the query works fine and returns the 0 to 93 records I want for the specific query. At this point I'm looking at some sort of "out of memory" issue on Android.

I never like/liked getting data in Excel for any project, but sometimes I don't have a choice.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Bob Sneidar
Sent: Monday, June 01, 2015 11:00 AM
To: How to use LiveCode
Subject: Re: SQLite and Android "Database Error:Unable to open the database file"

I don’t think it has anything to do with the data in the database, unless the database has been corrupted. If the database is already open by another device, sqLite will not allow you to open it. sqLite is a single user database. 

Try opening the database with an sql utility. Fairfax has a great sqLite plugin that I use all the time. I think it can even check the database for inconsistencies. 

Also, I would be reticent to use Excel or any office product when running your data through it, simply because they take the liberty sometimes of changing bits of your data to something else. For instance, I could not figure out why I could not get copiers to import data I had exported from another copier, when other techs were having no problem at all. Then I realized I was using a Macintosh. I checked a file that had been opened and saved in OS X Office 2011 by opening it in Livecode as a low level file and checking for anything that was not an ASCII character within certain limits and discovered Office for Mac was converting the copier Line Feeds to Carriage Returns, which the copiers import routines did not recognize. I have also seen Word convert normal quotes to smart quotes. 

If you do use office to view your files, ensure that all autocorrect features have been disable *before* you even open the file. 

Bob S


> On May 29, 2015, at 14:20 , Ralph DiMola <rdimola at evergreeninfo.net> wrote:
> 
> I am getting the dreaded and extremely unhelpful "Database Error:Unable to open the database file". This only happens on Android. Works in the IDE on either Mac or PC. Works on iOS. Fails only with some queries. Other queries work just fine. This started after I added some data. If I just add additional criteria to a select query encompassing new data that failed then query will work? Or if the first item in the WHERE clause does not reference any of the new data it works. You can select ALL the data and it works. I'm guessing that there is some data inconsistency that only the Android library cares about. Any ideas how to run this down? Are there any utilities to verify the integrity of an SQLite DB? I load the db from an LC utility that shells to export a .xls to a .txt tab delimited file and then reads in the text file and adds records to the DB.
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdimola at evergreeninfo.net
> 
> 
> _______________________________________________
> 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