Page 1 of 1

Problem with MemData.StopWaitProc

Posted: Thu 24 Feb 2011 10:42
by horsi
We lack the hourglass cursor when opening/executing queries/stored procedures. We searched the source code and found StartWaitProc and StopWaitProc in MemData module.

Code: Select all

procedure AppStartWait;
begin
  Screen.Cursor := crSQLWait
end {AppStartWait};

procedure AppStopWait;
begin
  Screen.Cursor := crDefault
end {AppStopWait};

initialization
  MemData.StartWaitProc := @AppStartWait;
  MemData.StopWaitProc := @AppStopWait;
Unfortunately, the above functionality is not working properly.
Please look at the code below:

Code: Select all

var
  lQuery: TUniQuery;
  lSP: TUniStoredProc;
begin
  [..]
  lQuery.SQL.Text := 'SELECT * FROM SOME_TABLE WHERE SOME_FIELD = :SOME_FIELD';
  lQuery.ParamByName('SOME_FIELD').AsInteger := 1;
  lQuery.Prepare;
  lQuery.Open; //<- Cursor remains as crSQLWait
  [..]
  lSP.Execute; //<- Cursor remains as crSQLWait
Opening/executeing query; executing Stored Procedure doesn't execute StopWaitProc.
Is this a bug?

--
License number: 00852.

Posted: Thu 24 Feb 2011 11:09
by AlexP
Hello,

Please specify the exact version of UniDAC.

Posted: Thu 24 Feb 2011 13:47
by horsi
AlexP wrote:Please specify the exact version of UniDAC.
Despite we have valid subscription (and access to the latest version) we still works with 3.00.0.11.

Posted: Thu 24 Feb 2011 15:13
by AlexP
Hello,

There are no AppStartWait and AppStopWait methods in the original MemData.pas file, and the initialization section looks like:

initialization
StartWaitProc := nil;
StopWaitProc := nil;

You can compare your MemData.pas with the original one (you can get it from the archive at secure*devart*com). If you changed the source code, try to replace your MemData.pas with the original one and rebuild UniDAC. The problem should disappear after this.

To make cursor change to crSQLWait on executing procedures/queries, you should add the UniDACVcl unit to the Uses section of any unit of the application.

Posted: Thu 24 Feb 2011 16:03
by horsi
AlexP wrote:There are no AppStartWait and AppStopWait methods in the original MemData.pas file, and the initialization section looks like:

initialization
StartWaitProc := nil;
StopWaitProc := nil;

You can compare your MemData.pas with the original one (you can get it from the archive at secure*devart*com). If you changed the source code, try to replace your MemData.pas with the original one and rebuild UniDAC. The problem should disappear after this.

To make cursor change to crSQLWait on executing procedures/queries, you should add the UniDACVcl unit to the Uses section of any unit of the application.
Sorry, I had a badly expressed.
Of course, that the module MemData.pas doesn't containt AppStartWait and AppStopWait procedures.

It contain only function variables: StartWaitProc and StopWaitProc.

The first code shows a fragment of my module.

Code: Select all

unit uSomeTests;

interface

implementation

uses
  MemData, Controls, Forms;

procedure AppStartWait;
begin
  Screen.Cursor := crSQLWait
end {AppStartWait};

procedure AppStopWait;
begin
  Screen.Cursor := crDefault
end {AppStopWait};

initialization
  MemData.StartWaitProc := @AppStartWait;
  MemData.StopWaitProc := @AppStopWait;
end.
We want to restore the behavior similar to that offered by BDE.
We want to hourglass cursor back when opening/executing queries/stored procedures.

And the previously presented code:

Code: Select all

var
  lQuery: TUniQuery;
  lSP: TUniStoredProc;
begin
  [..]
  lQuery.SQL.Text := 'SELECT * FROM SOME_TABLE WHERE SOME_FIELD = :SOME_FIELD';
  lQuery.ParamByName('SOME_FIELD').AsInteger := 1;
  lQuery.Prepare;
  lQuery.Open; //<- Cursor remains as crSQLWait
  [..]
  lSP.Execute; //<- Cursor remains as crSQLWait
was intended to show that there is something wrong.
Uff, :wink:

Posted: Fri 25 Feb 2011 10:39
by AlexP
hello,

As I wrote you earlier, to make cursor change on executing procedures/queries, you should only add the UniDACVcl unit to the Uses section.

In some cases we don't call the Start/Stop methods and just change the cursor, that's why there may be no call for these methods and the appearance of the cursor won't change.

Posted: Mon 28 Feb 2011 06:48
by horsi
AlexP wrote:As I wrote you earlier, to make cursor change on executing procedures/queries, you should only add the UniDACVcl unit to the Uses section.
Indeed, adding the UniDacVcl.pas module solves our problem.
Thank you very much!

Posted: Mon 28 Feb 2011 07:15
by AlexP
Hello,

It is good to see that this problem was solved. If any other questions come up, please contact us.