Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Using a template query does not work

From: Maarten Schrijvers <maarten.schrijvers(at)gmail.com>
Date: Thu Sep 27 2007 - 10:23:29 EDT


I have written the following code, using a template query. But it goes wrong somehow. I am using VS2005

static std::string vNaam;
// etc...

mysqlpp::Query qInsRel = con.query();
qInsRel << "INSERT INTO tblrelatie (Naam, Voornamen, Roepnaam, Geslacht, SoFiNummer, ddGeboorte,"
" Geboorteplaats, Nationaliteit, TitelID, RelatiesoortID, Voorvoegsel,
PartnerID) VALUES "
"(%0q, %1q, %2q, %3q, %4q, %5q, %6q, %7q, %8q, %9q, %10q, %11q)";
qInsRel.parse();

MessageBox::Show(ToUCS2(vNaam.c_str()),"En nu?"); //want to see if my variable still has the correct value (it does)

mysqlpp::ResNSel InsRelRes = qInsRel.execute(vNaam, vVoornamen, vRoepnaam, vGeslacht, vSofi, vddGeboorte, vGebpl, vNationaliteit, vTitelID, vRelatiesrtID, vVoorvoegsel, vPartnerID);

String^ prev = ToUCS2(qInsRel.preview().c_str()); //using this in a messagebox to see what the query looks like...This is my last breakpoint before things go wrong

It compiles just fine. But then at run time it does this:
"An unhandled exception of type 'System.Runtime.InteropServices.SEHException'
occurred in mysqlpp.dll
Additional information: Een extern onderdeel heeft een uitzondering veroorzaakt."
VS then points at query.cpp line 385 "SQLString& param = (*c)[num];" c and param are <undefined value> num is 0 (which I assume it should be) What am I doing wrong?
Thanks, Maarten Received on Thu Sep 27 10:23:59 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:03:23 EDT

Do you need help?X

Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library