Home » U++ Library support » U++ SQL » Application crashes when connected to MySQL, what am I doing wrong?
Re: Application crashes when connected to MySQL, what am I doing wrong? [message #45137 is a reply to message #45113] |
Mon, 14 September 2015 08:33  |
 |
mirek
Messages: 14261 Registered: November 2005
|
Ultimate Member |
|
|
void MyApplication::MyQuery1()
//Here's my query
int ritorno = Select(SqlSum(N_BOB))
.From(PEZZATURE)
.Where( COMM == ~dlgSceltaPezzature.strLav3A );
Not that this is not correct. This is not executing query, just creates Select structure and converts it to bool (->true -> 1).
You should use something like
void MyApplication::MyQuery1()
//Here's my query
int ritorno = my_sql_session % Select(SqlSum(N_BOB))
.From(PEZZATURE)
.Where( COMM == ~dlgSceltaPezzature.strLav3A );
Anyway, as for your original problem, hard to say what was causing the issue. Technically, creating session for each query should work. However, it is not a good idea at all, usually creating (and destroying) session takes certain amount of time, so it is ineffective.
As 90% of applications work with just single SQL backend, we have that global SQL session support....
Mirek
|
|
|
Goto Forum:
Current Time: Wed Jun 25 16:41:20 CEST 2025
Total time taken to generate the page: 0.03889 seconds
|