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 know this has to do with ADO trying to locate a row by specifying each field it knows about, as in "select * from customer where [Name]="Me" and [Address]="Someplace" and so on for each field. In my application, I use a t Ado Data Set with a simple Command Text like "select * from Customer".
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.
*Native Error: 32 *SQL State : Thanks, Bill N Bill, Another process could have changed a value that the DB manager is using to locate the row. Value := ad Criteria Key; ad Criteria Key is defined in ADOInt. If your table don't have a primary key make sure u fill every single field with a value instead of NULL (I'm not sure whether this is a correct approach, but at least it work for me). I' using Delphi 7 with ADO components with an Access database. Is there a way to set the SQL generation to just use the key? I delete one record and when I reopen my app I find that two have been deleted instead. "Brian Bushay Team B" When you use clientside cursors and make changes or delete a record in the client ADO needs to Generate SQL to update (or delete) the Record in your database.
The number one offender is the lack of a primary key in your data when you try to post it back to the DB. I have been sporadically getting a "Row cannot be located for updating" error. In this instance, I am just building a desktop application. To do this it must be able to find the record in your database that corresponds to the record you are editing.
Text; //additional fields here Post; end; end; end; What is the tbl Main? Properties['Update Criteria'].value := ad Criteria Key; end; Then do the sort in the On Activate of form procedure Tfrm Main.
2004-01-06 AM delphi88 First of all best wishes to everyone. In my application, I use a t Ado Data Set with a simple Command Text like "select * from Customer".
I have searched this NG and also Tamarack but cannot find this message anymore. It is a simple table I am trying to update, not a join.
The insert/update trigger pulls information from other tables and populates some fields of the table being inserted/updated which makes for ADO to not being able to find the just inserted record back.
Text; //additional fields here Post; end; end; end; procedure Tfrm Edit Click(Sender: TObject); begin with frm Coin, tbl Main do begin if Show Modal = mr OK then begin Edit; Field By Name('Title')String:= edt Title. If yes, set the Cursor Location=cl Use Server With best regards, Mike Shkolnik Mike, That works..only if I comment this line out //tbl Main.
Text; //additional fields here Post; end; end; end; Sorry, this is the code for the add procedure procedure Tfrm Add Click(Sender: TObject); begin //************************* with frm Coin, tbl Main do //************************* begin if Show Modal = mr OK then begin Insert; Field By Name('Title')String:= edt Title. Sort := 'Title, Year, Version, Finish'; using sort and or Index Field Names to sort the table, wont work on Server Side Cursors Anyway to sort my table in my grid using your suggestion? procedure Tfrm Main After Open(Data Set: TData Set); begin tbl Main.
I get this error message "Row cannot be located for updating.