I'm using VisualStudio 12 for develop one app. In that app i need do some mySql call's, i have that code:
sql::Statement *stmt = db->global->createStatement();
sql::ResultSet *res = stmt->executeQuery("SELECT * FROM `tbl_jobs` WHERE name = 'maintenance';");
Server->maintenance = (res->getString("data") == "on")? true : false;
The query is ok, work's well on Navicat, but on:
res->getString("data")
Ever throw's that error:
Unhandled exception at ...: Microsoft C++ exception: sql::InvalidArgumentException at memory location ....
If i done sql::SQlException throw i get this log:
ERROR: SQLException in .... Function: main on line 33 ERROR: MySQL_ResultSet::getString: can't fetch because not on result set (MySql error code: 1544116026, SqlState: MySQL_ResultSet::getString: can't fetch because not on result set)
I understan the sql::ResultSet don't have any data, but if i print res->rowsCount() say me are 1 row... I tryed with res->first(), but throws random error's.
¿Any ideas? :c