Recent

Author Topic: [SOLVED] DBGrid, a firebird big table and ZEOS  (Read 4730 times)

Mando

  • Full Member
  • ***
  • Posts: 181
[SOLVED] DBGrid, a firebird big table and ZEOS
« on: June 27, 2012, 08:57:15 pm »
Hello:

I've a Firebird big table (+100,000 records) and this is my problem:

I do a query like this

SELECT * FROM PEDIDOLIN

using a TZQUERY. I've a DBGRID, where I want to see the data. Well, if the  DBGRid is not linked to the ZQUEY, this opens to the speed of light, but if the DBGRID is linked to the ZQUERY, takes several seconds to display data. I supose this is because the grid loads all records. There are any way to change this behavior and do like flameRobin.

regards
« Last Edit: June 28, 2012, 06:42:24 pm by Mando »

Mando

  • Full Member
  • ***
  • Posts: 181
Re: DBGrid, a firebird big table and ZEOS
« Reply #1 on: June 28, 2012, 03:41:57 pm »
Hello:

I also tested SQLdb. in Both  cases I obtained the same result when query control isn't connected to a grid. But with SQLdb, the grid doesn't load all the records.

It is possible this with zeos?

regards.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: DBGrid, a firebird big table and ZEOS
« Reply #2 on: June 28, 2012, 04:01:49 pm »
Mando,

I don't know as I don't know Zeos. If you don't get an answer here (and have searchted the wiki and this forum), perhaps it's a good idea to ask on the Zeos forum as your issue is presumably more linked to Zeos than to Lazarus...

I think the Zeos article on the wiki has the forum address.

Good luck,
BigChimp
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: DBGrid, a firebird big table and ZEOS
« Reply #3 on: June 28, 2012, 04:34:28 pm »
TZQuery.FetchRow:=10; will do something similar as sqldb. It'll fetch 10 rows and then rows when needed. Watch out for some pitfalls when using this:
-TZQuery.RecordCount will return the number of rows fetched, not the number of rows in the table.
-For some database backends you can't commit a transaction when not all rows are returned.
-Some database backends don't allow multiple simultaneous active queries and the select will remain active until all records read.
« Last Edit: June 28, 2012, 04:36:05 pm by ludob »

Mando

  • Full Member
  • ***
  • Posts: 181
Re: DBGrid, a firebird big table and ZEOS
« Reply #4 on: June 28, 2012, 06:41:31 pm »
Thanks for your responses.

ludob: That's the solution, I feel very stupid.


Regards.



 

TinyPortal © 2005-2018