I have just an adoquery and when i try
adoquery1.sort := 'Cost';
![]()
it does not sort the items in the query.
Glen Morse
Glen MorseGlen Morse
70877 gold badges3636 silver badges8383 bronze badges
1 Answer
Where do scanned documents go in windows 10. 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 bummibummi
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.
25.4k88 gold badges5353 silver badges9292 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged delphidelphi-xe2 or ask your own question.
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.
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:
Delphi Ado Query Sort Multiple Dates
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.
Fo4 power armor mods. 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.
kobik
18.3k33 gold badges4646 silver badges102102 bronze badges
DelphiLearnerDelphiLearner
1 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 ?
You can create a Stored-Procedure and call it for updating and keep using the Client-Side Cursor Location
Cursor-Location must be combined with a proper Cursor-Type to get a good result, this article will help you :
G3ntle_ManG3ntle_Man
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged sql-serverdelphidelphi-7ado or ask your own question.Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |