Quantcast
Viewing latest article 7
Browse Latest Browse All 15

Android query and excute problem

hello,

I need your help

I have two javascript files, the first called main contains some of the following code

SearchText.addEventListener('change', function(e) {
    if(SearchText.value == "") {
 
    }else{
        //alert(SearchText.value)
        var szSQL = 'SELECT Word FROM Words ' +
                         'WHERE Word >= "' + SearchText.value + '" AND Word <= "' + SearchText.value + '}"';
             var rows = Ti.App.database.execute(szSQL);
 
....
and the second named database has the connection to the database and the variable
var openDatabase = function(e) {
    var dir = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory);
    return Ti.Database.open(Ti.Filesystem.getFile(dir.nativePath, Ti.App.databaseName + '.sqlite'));
};
 
var database = null;
...
database = openDatabase();
the problem that throws me is the following
TypeError: Cannot call method "execute" of undefined (file:///.../main.js#xxx)
I add and I'm still giving the same error

Viewing latest article 7
Browse Latest Browse All 15

Trending Articles



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