Board index » delphi » MSSQL 2000 - ADO - Requery question

MSSQL 2000 - ADO - Requery question


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 =
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:MSSQL 2000 - ADO - Requery question


With queries, the only reliable way to refresh the data is Close and Open.
This has the effect of rerunning the query.


Other Threads