Link to home
Start Free TrialLog in
Avatar of selas
selas

asked on

Progressbar while opening DB

I want to putt ProgressBar while opening a DB.        
How to make progressar move then opening Form8 with dbgrid
database size about 20 MB
Avatar of mokule
mokule
Flag of Poland image

You should not use dbgrid with such an amount of information.
It makes no sens for any user.
You should use query to select needed information.
Avatar of selas
selas

ASKER

And then how to show it?
-- how to show it?

you can use a TADOCOnnection component (ADO pallete) to create the conecttion with your database...then you can use a TADOQuery (conecction = TADOCOnnection) and write some query like this... 'select * from my_table' then add a datasource (Dataset = TADOQUery) and dbgrid ...that's it...
Avatar of selas

ASKER

I do the same :/
But how to show progressbar (moving)
then getting about 20 Mb of information?
1. you must set CursorLocation = clUseClient for your TADOQuery
2. you must set CursorType = ctStatic
3. you must include the eoAsyncFetchNonBlocking flag in ExecuteOptions
property
4. write next code in OnFetchProgress event:
procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet;
  Progress, MaxProgress: Integer; var EventStatus: TEventStatus);
begin
  Progressbar1.Max := MaxProgress;
  Progressbar1.Position := Progress;
end
Avatar of selas

ASKER

maybe there is other way?
because in this way progress bar moves only in the end and very fast
Avatar of selas

ASKER

How to move progressbar in splashscreen?
then opening form with DbGrid?
ASKER CERTIFIED SOLUTION
Avatar of ThoseBug
ThoseBug

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of selas

ASKER

If i use fetch process it work, but not good
then i use this query: Select '* from klientai order by id
it moves ok!

but if i use: Select id, slapyvardis, lankomumas, zaidzia, sum(inesta), sum(atiduota), sum(balansas), (sum(inesta) * 0.005 + sum(atiduota) * 0.0025) as bonusai, laikas, ivede, krupje from esantys where laikas > '+QuotedStr(DateToStr(Now()))+' group by id order by laikas desc

it moves only on last of ten second

How to solve it?