• Advertisement
Sign in to follow this  

MySQL++ problem

This topic is 2966 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.
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;
};

Share this post


Link to post
Share on other sites
Advertisement
put:
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement