Board index » delphi » DELPHI ADO & MS SQL 2000 Requery question

DELPHI ADO & MS SQL 2000 Requery question

Hi,

I'm using MS SQL 2000 and Delphi 5 Enterprise with ADO update 2.
To edit record in the database (UPDATE) I use stored procedure where i pass
the update statement
for one record also cheking if current timestamp value of the record is
equal to that then user retrieved the record for updating
in case of another user could modify the same record. I call stored
procedure from ADOConnection object:

ADOConnection.ExecSQL (sql) where sql is like (EXEC PROC bla..... and so on)

On the user form i use databound controls to display data ( I use ADOQuery
to access the data and pass them to data controls)
Then I modify the data SP runs perfectly, changes data, I want to use
ADOQuery.Requery method to refresh data in controls.
Then I get an error saying that "Optimistic concurency check failed. The row
was modified outside of this cursor". ADOConnection.CursorLocation =
clUseServer;
IsolationLevel = ilSerializable, ADOQuery.LockType = ltOptimistic,
cursortype = ctKeyset.

The question is how to refresh the data without closing and opening ADOQuery
cause it's just taking too long in case of 100.000 records
for example. I tried using Resync but it shows the same message. How to
solve it?

Thanks in advance.

 

Re:DELPHI ADO & MS SQL 2000 Requery question


Hi

I too get these 'internal' errors all the time in ADO.  If I get v large
numbers of them it sometimes affects performance.

With regard to your question, it looks to me as though NULL values in the
lookup key field cause one of these internal errors.  Is this what's
happening to you?

Stuart Seath

Other Threads