we have migrated a Delphi Project(Banking Application) from BDE to ADO and we have kept all the default properties as is and while unit testing there are issues.
Jun 17, 2010 Returning multiple datasets with ADO and Delphi June 17, 2010 by Rodrigo 5 Comments Maybe when you’ve used the SQL Server Management studio ‘ve noticed that you can run multiple.
One issue is 'Row cannot be located for updating. Some values may have been changed since it was last read'
the Issue is coming while updating a table. Table employee is having Update trigger and it is updating same table(Employee) based on some checks.whether trigger updates the table or not system is throwing above error.
Most Suggested Solution : ADODataSet1.Properties['Update Criteria'].value :=adCriteriaKey;
and it didnt work.
After googling we have come to know there are some properties like Cursor location and Cursor Type which are important while working with ADO.
we have just changed Cursor Location to clUseServer from clUseClient and it started working(magic) and we dont know why it is working.
now we are super confued what cursor location or Cursor type to use.
About My Application:
1) List view or DBGrid to show the records to user.
2) we are using data aware controls(more controls).
3) there are lots of inserts , updates and deletions
3) there are around 1000 users who uses this application. How to install wow add-ons windows 10.
4) Same user can work on same screen/Record.
after going through Client-Side Cursors Versus Server-Side Cursors we are planning to for Server Side cursors.
kobik1 Answer
First of all I suggest you to forget the ADO and use FireDAC (or UniDAC)
This problem occurs when you are using triggers or sometimes you set the default values for fields, because ADO can't find the Record you want to update it in Client-Side
If you set the cursor location to Server-Side you will lose some good feathers like Local Sorting, Local Filtering and Local Indexes, your records will not keep on the Memory and speed of your DataSet will be decreased, Server-Side location also can have bad effects on Server's resources
What RDBMS you are using ?
Delphi Ado Query Sort Multiple Dates
You can create a Stored-Procedure and call it for updating and keep using the Client-Side Cursor Location
Sql Query Sort
Cursor-Location must be combined with a proper Cursor-Type to get a good result, this article will help you :
Not the answer you're looking for? Browse other questions tagged sql-serverdelphidelphi-7ado or ask your own question.
I have just an adoquery and when i tryadoquery1.sort := 'Cost';
it does not sort the items in the query.
Delphi Ado Query Sort Multiple Page
1 Answer
Adoquery.Sort should work if you set CursorLocation to clUseClient.
The alternative could be changing your query to:
which will select 4 random rows and sort these by Cost.
EDIT
as follow up to @kobik 's comment:
If you are already using clUseClient and your sort does not seem to work you will have to make sure the sorting can be interpreted in your intent. If you are using an Wide(String)field it will be sorted as any string (10,8,9). You might either change the field type to int or float, or add an casted field to you query for sorting purpose (CINT(TextFiled) as IntForSort ,CDBL(Textfield) as FloatForSort for Access).
Since this might lead to converting errors if the content of the field can not be casted, so I'd recommend to use the intended field type on design of the table.