Load one single record each cursor movement

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Gianluca
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Load one single record each cursor movement

Post by Gianluca » Thu 20 May 2010 13:59

(Unidac 3.0 - Delphi2010 - MySQL)
I would load (fetch) a single record from server, also if the sql select more one. In this way, I could use all properties of TUniQuery without load eg. milions of records in a sigle time. Every scroll of TDBNavigator load one record! Is it possible?

Is there a property to make this?


thank you very much

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Thu 20 May 2010 14:12

Hi,
have you tried to set "SpecificOptions.Add('FetchAll=False');" and "FetchRows := 1;" ?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 21 May 2010 06:40

Also you can set the TUniQuery.UniDirectional property to True.

Gianluca
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Post by Gianluca » Fri 21 May 2010 06:46

>have you tried to set "SpecificOptions.Add('FetchAll=False');" and "FetchRows := 1;" ?
No I dind'try to set fetch=1. Thank you I will try.

>Also you can set the TUniQuery.UniDirectional property to True.
But with unidirectional can I move cursor back as well?

Anyway I'm goint to try. Thank you.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 21 May 2010 07:12

> But with unidirectional can I move cursor back as well?

No, the UniDirectional mode doesn't allow to move cursor back. UniDirectional is used if an application does not need bidirectional access to the records in the result set.

Gianluca
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Post by Gianluca » Fri 21 May 2010 08:32

>No, the UniDirectional mode doesn't allow to move cursor back. >UniDirectional is used if an application does not need bidirectional access to >the records in the result set.

I see, but a need to move back and forward.

I saw that with a grid and property FetchAll=False and FetchRows=1 it fill the grid with all records anyway.
But with a detail view (record with field on TDBEdit control) it works the same?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 21 May 2010 09:29

When FetchAll = False, then on opening dataset the FetchRows rows will be fetched from database and control will be returned to the application. But the rest of the records will be retrieved when a data-aware component or a program requests it. In your case the DBGrid component requests as many records as it can show on display.

Gianluca
Posts: 13
Joined: Wed 28 Apr 2010 08:31

Post by Gianluca » Thu 27 May 2010 08:28

Thak you very much.
It works :)

Post Reply