5 messages in com.mysql.lists.plusplusRe: Application error (windows)| From | Sent On | Attachments |
|---|---|---|
| J.Hoeve | 24 Aug 2001 02:29 | |
| J.Hoeve | 24 Aug 2001 04:31 | |
| Vadim Berezniker | 24 Aug 2001 05:07 | |
| J.Hoeve | 24 Aug 2001 05:36 | |
| Vadim Berezniker | 24 Aug 2001 10:05 |
| Subject: | Re: Application error (windows)![]() |
|---|---|
| From: | Vadim Berezniker (vad...@berezniker.com) |
| Date: | 08/24/2001 10:05:52 AM |
| List: | com.mysql.lists.plusplus |
This indeed is a strange conclusion. A public or private function can access any other member function or variable. In any case, the compiler *should* prevent you from accessing data you are not supposed to.
Have you tried these things: a) Check if the connection was successful? after con->connect(dbase, "localhost", "root"); add if(!con->success()) { cout << "connection failed: " << con->error << endl; exit(1); }
b) Since you are enabling exceptions, have you tried actually catching them? i.e. try { con -> connect(dbase, "localhost", "root"); } catch(...) { cerr << "something was thrown!" << endl; exit(1); }
Instead of catching everything, you should catch BadQuery, etc, depending on the action.
J.Hoeve wrote:
i now have this: bool Database :: DoConnect(char *dbase) { con = new Connection(use_exceptions); try { con->connect(dbase, "localhost", "root"); query = con->query(); }
etc
does NOT work. continues to crash.
changed everything to work WITHOUT pointers. allright, everything's OK. BUT:: when i do the following: query = con.query(); (was commented), it starts crashing again. i've tried to put the Query object both in the private section and the public secition. neither works :(
therefore i conclude i can't write to private or public attributes in the Database class. (resulting in app errors). is this a strange conclusion? how can i solve it?
Jan
-----Original Message-----
[SNIP]
-- AIM: Kryptolus BrainLINK Web Development Team [http://www.brainlink.com]




