Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

problem with invalid SQL statement

$
0
0

Hi guys, untile yesterday my app worked correctly and I was able to use my sqlite db. I have made no change and today I recived this error: invalid SQL statement.

This is my code:

var db = Ti.Database.install('ui/common/account.sqlite','account');
 
 
var rows = db.execute('SELECT DISTINCT nome FROM account');
var rows1 = db.execute('SELECT DISTINCT server FROM account');
 
 var search = Titanium.UI.createSearchBar({
        barColor:'white',
        //borderColor: 'black',
        //borderRadius: '1',
        showCancel:false,
        height:'44dp',
        hintText:'Cerca...',
        //top:'0%'
    });
 
    search.addEventListener('change', function(e)
    {
        e.value; // search string as user types
        // return e.value;
    });
    search.addEventListener('return', function(e)
    {
        search.blur();
    });
    search.addEventListener('cancel', function(e)
    {
        search.blur();
    });
 
// create table view
var tableview = Ti.UI.createTableView({
    top:'2%',
    height:(Ti.Platform.displayCaps.platformHeight)-145,
    search:search, //here will set search bar
    filterAttribute:'filter',   
});
 
var dataArray = [];
 
//var rowarray = [];
var i= 0;
 
while (rows.isValidRow())
 
 
{
 
 
        var row = Ti.UI.createTableViewRow({
        backgroundImage : "/ui/common/images/tabaccount.png",
        selectedBackgroundImage : "/ui/common/images/tabaccount.png", 
        title:'' + rows.fieldByName('nome') + '',
        height : '42',
        color : "transparent", //change text color
        selectedColor :"transparent", 
        filter: rows.fieldByName('nome')
    });
 
     var testosopra = Ti.UI.createLabel({
        color:'#555555',
        text:'' + rows.fieldByName('nome') + '',
        font:{fontFamily:'Raleway',fontWeight:'bold',fontSize:'14dp'},
        left: '2%',
        top:'8%'
    });
    row.add(testosopra); 
 
    var testosotto = Ti.UI.createLabel({
        color:'#555555',
        text:'' + rows1.fieldByName('server') + '',
        font:{fontFamily:'Raleway',fontWeight:'normal',fontSize:'12dp'},
        left: '2%',
        top:'56%'
    });
    row.add(testosotto); 
 
    dataArray.push(row);
    rows.next();
    rows1.next();
 
    i++;
 
 
 
 
};
 
db.close();
In my db file I have 5 colums: nome, server, username, password, autorizzato.

What can I do?

Thanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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