Re: MS SQL 2000, ADO and edit lock



I have the following code

procedure TForm1.Button1Click(Sender: TObject);
begin
with ADODataSet1 do
begin
LockType := ltPessimistic;
CommandText := 'SELECT * FROM INC_HEAD WITH (HOLDLOCK, ROWLOCK) WHERE ID
= 43620';
try
Open
except
on E: Exception do
ShowMessage('Exception: ' + E.Message)
end
end
end;

I launch the first instance of app, click Button1, the row is shown in the
Grid.
Then I launch the second instance, click Button1 and it hangs for about 30
seconds or so,
and then empty grid is shown.

CursorLocation is set to clUseServer.

Is there a way to avoid the delay and have it immediately raise an
exception?

"Del Murray" <Del.Murray@xxxxxxxxxxxxxx> wrote in message
news:4754122e@xxxxxxxxxxxxxxxxxxxxxxxxx


.


Quantcast