int main(int argc,char **argv)
{
mysqlpp::Connection conn(false);
if(conn.connect("warrior","localhost","root","mypw") == false)
{
cout << "Nope.";
cin.get();
}
else
{
cout << "Yes.";
cin.get();
};
mysqlpp::Query squery = conn.query("SELECT * FROM player");
return 0;
};
MySQL++ problem
I'm having issues with the code below. I finally managed to get my application to connect to the SQL database using mySQL++, but it refuses to process my query properly. When I run it, I get the error "Run Time Check Failure #2: The stack around the variable squery was corrupted."
Can someone please tell me whats gone wrong? Any help would be appreciated. Its driving me nuts. Thanks.
put:
Other than that, do a full rebuild of the library and the project.
try {... } catch (const mysqlpp::BadQuery& er) { cerr << "BadQuery: " << er.what() << endl; } catch (const mysqlpp::BadConversion& er) { cerr << "BadConversion: " << er.what() << endl; } catch (const mysqlpp::Exception& er) { cerr << "Exception: " << er.what() << endl; } catch (...) { cerr << "foo" << endl; }
around the code.Other than that, do a full rebuild of the library and the project.
My guess is that the mysql++ library was built for another version of the compiler than what you're using.
But without more information, it's impossible to know for sure. Try single-stepping at the assembly level in the debugger, and see what gets corrupted. Re-start the program, and set a data breakpoint on that address, and see what writes to it.
But without more information, it's impossible to know for sure. Try single-stepping at the assembly level in the debugger, and see what gets corrupted. Re-start the program, and set a data breakpoint on that address, and see what writes to it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement