BioBytes Messages: 310 Registered: October 2008 Location: France
Senior Member
Thank you very much for your reply. Your code is ok. My problem is that it is not possible to build the query as shown in the attached file. In my project, the user can select different parameters to include dynamically the query by checking option boxes and selecting the wanted specific data in the droplist associated with the box.
Therefore I reviewed my code to test every combination to build the corresponding sql query as shown in the attached file but it is a bit complicated.
I also used Code::Blocks with wxWidgets and DatabaseLayer libs and the sql query can be build in runtime as follows:
wxString query;
wxListBox *lb1;
wxListBox *lb2;
query.Append(_T("Select * from codetechnic where code famille="));
query.Append(_T("'"));
query.Append(lb1->GetStringSelection());
query.Append(_T("'"));
query.Append(_T(" and codeproduit=");
query.Append(_T("'"));
query.Append(lb2->GetStringSelection());
query.Append(_T("'"));