Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (such)
Viewing all articles
Browse latest Browse all 4

sqlite works, but sql gives no such table error

$
0
0

this is the install code in the app :

works fine:

function sqliteDB()
{
 
var db = Ti.Database.install('/Test1.sqlite', 'test1'); 
var a  = db.execute('SELECT title FROM archive');
 
 
 var counter=0
 
    while (a.isValidRow())
    {
 
    label1.text+=a.fieldByName('title')+'\n';
 
    counter++;
    a.next();  
    }   
 
 
a.close();
db.close();
 
 
}

not work :

function sqlDB()
{
 
var db = Ti.Database.install('/Test1.sql', 'Test1');
var a  = db.execute('SELECT title FROM archive');
 
 
 var counter=0
 
    while (a.isValidRow())
    {
 
    label1.text+=a.fieldByName('title')+'\n';
 
    counter++;
    a.next();  
    }   
 
 
a.close();
db.close();
 
 
}

i always delete the app from device and re-install after any change in the db

using android 2.3 , ti 2.0.3


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>