You want to connect to the SQLite database using single class with easy to use methods.
Create an instance of SQLite connector class (https://sourceforge.net/projects/windrotor/files/Clasess/DBConnectors/jlcSQLiteDBConnector.js/download).
var CurDBConnector = new jlcSQLiteDBConnector();
var tmpDBFile = air.File.applicationStorageDirectory.resolvePath('database\\main1.db');
var tmpSQLQuery = '';
var Counter1 = 0;
try
{
CurDBConnector.CreateDBFile(tmpDBFile, true, 'update');
}
catch (usrError)
{
return false;
}
try
{
tmpSQLQuery =
"CREATE TABLE IF NOT EXISTS deluxe_coachwork_link (" +
" id INTEGER PRIMARY KEY AUTOINCREMENT, " +
" sportsmenwork INTEGER, " +
" coachwork INTEGER " +
")";
CurDBConnector.SetQuery(tmpSQLQuery);
CurDBConnector.ExecuteQuery(tmpSQLQuery);
}
catch(usrError)
{
return false;
}
+