Row cannot be located for updating some values

Posted by / 04-May-2015 03:03

I've also tried setting the 'Update Criteria' property of the dataset to ad Criteria Key in ADOData Set. Actually, I found a way to overcome the problem, probably not very elegant and maybe resource-consuming. ADOData Set1After Post(Data Set: TData Set); var Bookmark: TBookmark; begin with ADODataset1 do begin Bookmark := Get Bookmark; Disable Controls; Requery(); Goto Bookmark(Bookmark); Free Bookmark(Bookmark); Enable Controls; end; end; Jet 4.0 is the last update available from Microsoft download. I run this test using Delphi 5 and 6 on Windows 98 and Delphi 7 on Windows 2000. However, my table has a primary key defined and rows can be uniquely identified using this key (an Int). Recently added an insert/update trigger to a table in SQL Server to populate some fields from a 2nd table.I've read some time ago in this NG (I believe) that you can limit the ADO where statement construct by informing the ADO recordset about this primary key (or rather: dropping the other fields). Since then inserting a new row gives the error "Row cannot be located for updating".I am getting an EDatabase error that says 'Row cannot be located for updating'.What causes this error and how can I handle it in my exception handling.But the problem seems to be on the Primary key fields, as they are not able to generate the proper increment value when I append a new record.

When I add a new record the Autoincrement field is not filled with the proper value but always with 0. This doesn't happen if Cursor Location is set to cl Use Server and Cursor Type to ct Key Set, but I don't know if this the right choice for a stand alone application.

//------------------------------------------ Regards, Vassiliev V. //------------------------------------------ Regards, Vassiliev V. //------------------------------------------ Regards, Vassiliev V. Some values may have been changed since it was last read".

Close and re-launch the de and the row is there, with the proper ID value. Properties['Update Criteria'].value to ad Criteria Key in the Before Refresh and Before Delete methods of both Datasets without result. And I have also set the Auto Generate Value property of ID in Detail Table to ar Auto Inc. I have just discovered that even the primary key of Master Table doesn't generate auomatically! Both primary keys in Master Table and Detail Table are Autoincrement field (Long Integer type).

At this point any operation fails (inserting a new record = duplication of the primary key; deleting the record = error message "Row cannot be located for updating."; refreshing = the same message). You can imagine what a nightmare when I also create a detail table connected with the master. Thank you very much and sorry for the long message.

The only way to get the proper value is to close and relaunch the program, so to read again the database. And in this case the provider even doesn't not support a server cursor ("Current provider does not support the necessary interfaces for sorting or filtering").

row cannot be located for updating some values-46row cannot be located for updating some values-75row cannot be located for updating some values-75