Всем доброго дня. Господа, подскажите - где я туплю. Есть функция:
int CCafe::get_stations_count(int status)
{
sqlite3 *conn;
sqlite3_stmt *res;
int error = 0;
ostringstream cmd;
int rec_count = 0;
const char *tail;
if(bdpath=="")
{
cout << "clean path to database";
}
error = sqlite3_open(bdpath, &conn);
if (error)
{
cout << "can not open database";
exit(0);
}
cmd << "select * from stations where status="<<status;
error = sqlite3_prepare_v2(conn,cmd.str().c_str() , 1000, &res, &tail);
if (error != SQLITE_OK)
{
cout << "error int get station count\n";
}
while (sqlite3_step(res) == SQLITE_ROW)
{
rec_count++;
}
sqlite3_finalize(res);
sqlite3_close(conn);
result=rec_count;
}