Your error is an ODBC/SQL error - the sequence of operations you are doing on the query is not right.
You probably will get more help from SQL/ODBC related forums.
However on a C++ level one thing seems odd in your code:
convention *c =new convention(id_c, nom_entreprise,pourcentage_c, date_expiration) ;
c->ajouter_convention(c);
convention *c =new convention(id_c, nom_entreprise,pourcentage_c, date_expiration) ;
c->ajouter_convention(c);
To copy to clipboard, switch view to plain text mode
Why are you creating an instance of 'convention' only to give it to it self?
Do you know what 'this' is?
Bookmarks