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.