?
Solved

Progressbar while opening DB

Posted on 2005-04-04
9
Medium Priority
?
405 Views
Last Modified: 2010-04-05
I want to putt ProgressBar while opening a DB.        
How to make progressar move then opening Form8 with dbgrid
database size about 20 MB
0
Comment
Question by:selas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 13699028
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.
0
 

Author Comment

by:selas
ID: 13704311
And then how to show it?
0
 
LVL 3

Expert Comment

by:ThoseBug
ID: 13706466
-- 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...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:selas
ID: 13708199
I do the same :/
But how to show progressbar (moving)
then getting about 20 Mb of information?
0
 
LVL 3

Expert Comment

by:ThoseBug
ID: 13708826
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
0
 

Author Comment

by:selas
ID: 13718310
maybe there is other way?
because in this way progress bar moves only in the end and very fast
0
 

Author Comment

by:selas
ID: 13725304
How to move progressbar in splashscreen?
then opening form with DbGrid?
0
 
LVL 3

Accepted Solution

by:
ThoseBug earned 1500 total points
ID: 13726768
procedure TForm1.FormCreate(Sender: TObject);
begin
  Try
    DataBase1.Connected:=True
  Except
    ShowMessage('Cannot open DB1')
  end;
  SplashForm.ProgressBar.StepIt;
  SplashForm.update;
  Try
    DataBase2.Connected:=True
  Except
    ShowMessage('Cannot open DB2')
  end;
  SplashForm.ProgressBar.StepIt;
  SplashForm.update;
  Try
    Table1.Active:=True
  Except
    ShowMessage('Cannot open Table 1')
  end;
  SplashForm.ProgressBar.StepIt;
  SplashForm.update;
  Try
    Table2.Connected:=True
  Except
    ShowMessage('Cannot open Table 2')
  end;
  SplashForm.ProgressBar.StepIt;
  SplashForm.update;
  ...
  SplashForm.Free
0
 

Author Comment

by:selas
ID: 13755465
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?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question