I think it would be good if I post the new DataBase.cpp
Code:
#include "DataBase.h"
#include <sqlite3.h>
#include <string.h>
#include <wx/msgdlg.h>
bool CanClose(void)
{
sqlite3 *Sqlite;
sqlite3_stmt *sqlstmt;
char *result;
const char*tal;
bool res;
if(sqlite3_open("SysConfig",&Sqlite)==SQLITE_OK)
{
int i=sqlite3_prepare_v2(Sqlite,"SELECT * FROM configuration WHERE config_id = 1;",100,&sqlstmt,&tal);
if(i==SQLITE_OK)
if(sqlite3_step(sqlstmt)==SQLITE_ROW)
{
result = (char*)sqlite3_column_text(sqlstmt,0);
wxString str;
wxMessageBox(str.FromAscii(result));
res=(strcmp(result,"YES")==1);
sqlite3_close(Sqlite);
return res;
}
else wxMessageBox(_("Statement Execution Error!"),_("Error!"));
else wxMessageBox(_("Cannot Prepare Statement"));
return 0;
}
else
{
wxMessageBox(_("Cannot Find System File!"),_("Error!"));
sqlite3_close(Sqlite);
return false;
}
}
now here I am getting that message box with "Cannot Prepare Statement"....
I copied the sql statement and pasted in sqliteman which gave me the desired result with out any error.
further more sqlite3_prepare_v2 is returning SQLITE_ERROR...