|
SQLite and AGUP behaving oddly |
Raf Vermeulen
Member #7,166
April 2006
|
The program I'm making's almost done, but it's got two more weird bugs. 1) When there's no database, and the user presses the Clear Data button, it should create the table needed. When the table already exists, it should flush it (or destroy it and make it again. My code for that, is:
It gives this error message twice: When I take away the Drop part and create without the table already existing, it works fine. If I do this, but when the table already exists, it says that the table already exists. 2) I've got a Quit-button at the main part of my application. Pressing Esc works as well. It first comes up and asks if you really want to quit. It works fine when pressing Esc, but when using the Quit-button, pressing Cancel still quits the program. This's the code:
To me, it all seems pretty logical, and I can't think of why it would act the way it does. |
CGamesPlay
Member #2,559
July 2002
|
To your first question, call query.str("") to remove the existing query from the stringstream before continuing. Right now you are trying to execute this SQL: Your quit proc looks like it will ask the user to quit everytime he presses a key, and that KEY_F10 checking seems wrong, because you ignroe the low bits in c. -- Ryan Patterson - <http://cgamesplay.com/> |
Raf Vermeulen
Member #7,166
April 2006
|
Thanks The dropping and recreating of the database works now. The F10 key to quit seems to've worked all the time, too. I'm really quite stumped at this one, as it all uses the same function. It must be something like it keeps sending a 1 through when using the button, while pressing a key sends a 1 through, immediately followed by a 0. Just dunno why it'd do that, or if it's actually that, let alone how to fix it. |
|