Discussion:
[soci-users] SOCI + Firebird
Mello
2013-07-17 16:48:49 UTC
Permalink
Hi all!
I new here, I'm trying to connect with firebird with this code:

#include <stdio.h>#include <tchar.h>#include "soci.h"#include
"soci-firebird.h"#include <iostream>
using namespace soci;
soci::backend_factory const &backEnd = *factory_firebird();;
int _tmain(int argc, _TCHAR* argv[])
{
session sql(backEnd, "service=DATABASE.FDB user=SYSDBA password=masterkey");

int count;
sql << "select count(*) from MYTABLE", into(count);

return 0;
}


but I recive this error on debug mode:
Unhandled exception at at 0x76AA4B32 in ConsoleApplication1.exe: Microsoft
C++ exception: soci::firebird_soci_error at memory location 0x00FCF24C.

And just running, works well... how can I solve?
Thanks for attention, Mello.
Mateusz Loskot
2013-07-17 19:13:54 UTC
Permalink
Post by Mello
int _tmain(int argc, _TCHAR* argv[])
{
try
{
Post by Mello
session sql(backEnd, "service=DATABASE.FDB user=SYSDBA
password=masterkey");
int count;
sql << "select count(*) from MYTABLE", into(count);
return 0;
}
catch (soci::soci_error const& e)
{
// handle error
}


Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Mello
2013-07-22 15:35:08 UTC
Permalink
Thanks, error comes only when I in debug mode. It was searching at wrong
location. Thanks!
Post by Mateusz Loskot
Post by Mello
int _tmain(int argc, _TCHAR* argv[])
{
try
{
Post by Mello
session sql(backEnd, "service=DATABASE.FDB user=SYSDBA
password=masterkey");
int count;
sql << "select count(*) from MYTABLE", into(count);
return 0;
}
catch (soci::soci_error const& e)
{
// handle error
}
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
soci-users mailing list
https://lists.sourceforge.net/lists/listinfo/soci-users
Loading...