Board index » delphi » Query Status...

Query Status...

Is it possible to indicate queryprogress on a statusbar?

Thanks in advance,

 Christophe.

 

Re:Query Status...


On Mon, 18 Oct 1999 10:43:45 +0200, "Christophe Van Hecke"

Quote
<rena...@planetinternet.be> wrote:
>Is it possible to indicate queryprogress on a statusbar?

Here is an example (using a TLabel):

var
  ProgressDesc: CBPROGRESSDesc;

function ProgressCallBack(ecbType: CBType; iClientData: Longint;
  CbInfo: Pointer): CBRType stdcall;
begin
  TForm1(iClientData).Label1.Caption := PChar(@ProgressDesc.szMsg);
  TForm1(iClientData).Label1.Update;
  Result := cbrUseDef;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  OldSession: hDbiSes;
begin
  Session.Open;
  DbiGetCurrSession(OldSession);
  DbiSetCurrSession(Session.Handle);
  DbiRegisterCallBack(nil, cbGENPROGRESS, Integer(self),
    SizeOf(ProgressDesc), @ProgressDesc, @ProgressCallBack);
  DbiSetCurrSession(OldSession);
  Label1.Caption := 'Preparing...';
  Label1.Update;
  Query1.Open;
  Label1.Caption := 'Done.';
end;

HTH,

Jan

Re:Query Status...


Quote
>Is it possible to indicate queryprogress on a statusbar?

Depends on how you define progress.   Jan gave you some code for hooking up a
query Callback procedure.  However all you get is what BDE sends back to you and
it is not very good.   Frequently there is nothing between start and finish.  if
there are a couple of steps they probably don't represent anything close to
matching the actual queries progress.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads