Boris Schaeling:
On Fri, 20 Feb 2009 09:36:53 +0100, Lian Cheng
wrote: Isn't there a list of error numbers and error strings MySQL uses? I ask as calling error_category::message() should also return an error string even if no MySQL connection is used?
Unfortunately, no. As I've mentioned, the error strings MySQL uses are printf format strings, such as: Using unsupported buffer type: %d (parameter: %d) And you always need an active MySQL connection handle to obtain the full error message by calling mysql_error(). And you can never get the message back once you close the connection: MYSQL* conn = mysql_init( 0 ); // do something causes an error. mysql_close( conn ); printf( "error: %s", mysql_error( conn ) ); // Messed up.
Boris