Hi,
I am facing problem cursor type when i am using SDAC components.
In my Project i have TMainMenu. I have MainMenu item and Five submenu item for the main menu. I have a MainMenu click event. In the menuclick event i have try..finally block. In the "try" block i am opening a query component and based on the dataset values i am changing the captions of the submenu's. In the "Finally" block i am closing the query.
The code in the MenuClick event is as below:
--------------------------------------------------------------------------------
try
Screen.Cursor := crDefault;
MsQuery1.Close;
MsQuery1.Open;
test := Sender As TMenuItem;
for i := 0 to test.Count - 1 do
begin
test.Items.Visible := False;
test.Items.Tag := 0;
end;
i := 0;
while (not MsQuery1.EOF) and (i < 5) do
begin
with test.Items do
begin
Caption := 'Success';
Visible := True;
Tag := 1;
end; { with }
Inc(i);
MsQuery1.Next;
end; {while }
finally
MsQuery1.Close;
Screen.Cursor := crDefault;
end; { try }
--------------------------------------------------------------------------
Now the Problem i have is the cursor is getting changed into crSQLwait state even though i am setting to crDefault before and after the query opening and closing.
Note: I have added sdacvcl to the uses clause of my unit as i need it for other purposes.
Can i know the reason for this and the solution to the same.
I am using SDAC 3.80 licensed version and Delphi 7 Version. Data base Version is SQL Server 2005.
Regards
balajee