5 messages in com.mysql.lists.plusplusQuery::execute()2 causes 'abnormal p...
FromSent OnAttachments
onno ernst31 Mar 2003 09:25 
Will Bryant31 Mar 2003 15:03 
onno ernst01 Apr 2003 06:48 
Will Bryant01 Apr 2003 14:31 
Sascha Herrmann03 Apr 2003 07:51 
Subject:Query::execute()2 causes 'abnormal program termination'
From:onno ernst (onno@arts-and-bits.net)
Date:04/01/2003 06:48:27 AM
List:com.mysql.lists.plusplus

At 12:03 AM 4/1/2003, you wrote:

"Here 'abnormal program termination' nothing is either updated or

executed." [snip]

What's going wrong? How to get out of this?

Are you using exceptions? Try catching the exception, and see what the message is.

After a try/cach exeption the Message is: 'Query was empty' Also query.preview() never returns a string.???

The code only works when I a use new Query object for every query I execute, as Gunther Lenz suggests.

like so: Query query2 = con.query(); query2 << "UPDATE playerinfo SET exp = 1000 WHERE id = 3"; query2.execute();

// or use query2.store();

query2 << "SELECT * FROM playerinfo WHERE id = 3"; res = query2.store();

cout << "Query: " << query2.preview() << endl; cout << "Records Found: " << res.size() << endl << endl; // here output is OK.

The funny thing is that twice here I use the same query, even when I use query2.store() instead of query2.execute() it works OK. Why I don't understand. Is it something typical for the win32 version?

The examples I got the code are from a book where they use the win32 version and reuse the same query, that is they make only one call to Query query = con.query(); troughout the whole program. Are these examples wrong? Hope to get some light in this.