Hello there,
I have a problem with installing a database;
In the app. js i have the following code:
var db = Ti.Database.install('radar.db', 'radar'); db.close();In my resources folder there is a file/database called radar.db. in another .js file i try to open the database with the following code: db = Ti.Database.open ( 'radar' );When i start the app i get a runtime error message wich says:
Location: ======= [102,19]ti:/invoker.js Message: ======= Uncaught Error: install: Invalid number of arguments. Excpected 3 but got 2 Source: ====== return delegate.apply(invoker.__thisOBj__, args);Its a mobile project using titanium sdk 2.1.2 GA for android 4.0.3
Does somebody have the answer for this problem?
Thanks in advance!
1 Answer
After a long tries i found an answer You need to give absolute path of database file..
like
var path = Titanium.Filesystem.resourcesDirectory; var store_dbname = 'stores.db';
db = Titanium.Database.install(path+'data/stores.db', store_dbname);
db.close();
here data is folder under Resources/ and stores.db is your database.
Thats it Hope this may help....
Your Answer
Think you can help? Login to answer this question!