Hi,
it works for me. I created just a small database file with sqlite3 using:
---------------------------------------------------------------------------------------
sqlite3 test.db <<EOF
create table foo (a int not null);
insert into foo(a) values(1);
insert into foo(a) values(2);
insert into foo(a) values(3);
insert into foo(a) values(4);
insert into foo(a) values(5);
insert into foo(a) values(6);
insert into foo(a) values(7);
insert into foo(a) values(8);
insert into foo(a) values(9);
insert into foo(a) values(10);
EOF
---------------------------------------------------------------------------------------
Then this code:
---------------------------------------------------------------------------------------
#include <iostream>
#include <tntdb/connect.h>
#include <tntdb/result.h>
int main(int argc, char* argv[])
{
try
{
tntdb::Connection conn = tntdb::connect("sqlite:test.db");
tntdb::Result res = conn.select("select a from foo limit 3");
for (tntdb::Result::const_iterator cur = res.begin(); cur != res.end();
++cur)
std::cout << cur->getInt(0) << '\n';
}
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
}
}
---------------------------------------------------------------------------------------
saved as sqlimit.cpp and compiled using:
g++ -o sqlimit -ltntdb sqlimit.cpp
ruinnig "./sqlimt prints this:
---------------------------------------------------------------------------------------
1
2
3
---------------------------------------------------------------------------------------
So it works as expected. Adding a offset to it does not change it. You must
have some other problem.
You may enable logging for your program to see, what happens. Just include
<cxxtools/log.h> and add a call to "log_init()" to your main. Create a
file "log.properties" with this:
rootLogger=I
logger.tntdb=D
This loggs the activity of tntdb to stdout. You may look at it or ask here for
help.
Tommi
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general