Error giving post by Delphi

Asked

Viewed 1,673 times

1

I have a table that only has a record this table I save the system parameters it only has one item saved and its item number in one will be greater than 1 so she has no primary key, only when I try to change the system parameters this error:

Update command updated [0] Instead of [1] record. Possible reasons: update table does not have PK or Row Identifier, record has been changed/Deleted by Another user.

Possible reasons: the update table does not have PK or line identifier, the write has been changed / deleted by another user.

The table does not need a PK as it does not relate to others and has not been changed by another user because I am running it locally for testing. Someone knows how to fix this?

  • The components you are using for data manipulation must be requiring a primary key, even if there is only one record in the table, why not create a PK? If you are using "Datasetprovider", you must change the "Updatemode" property to "upWhereAll"

  • I’m not using the DataSetProvider I’ll change the connection component options to see if it works

  • My table uses three columns as PK and was giving this message. [SOLUTION] The only thing I did was change the Keyfields property in Datasource, I added the three columns.

  • Check if your field where the primary key is, is the first one in the table mentioned. This happened to me.

3 answers

2


Searching further I found this on the site docwiki.

The UpdateOptions.UpdateMode controls the generation of the clause WHERE to publish updates and exclusions. The default value upWhereKeyOnly uses in the phrase WHERE only the unique identification columns and provides an efficient and secure way to locate the update line. When no unique identification column is specified and no row identification column is found, Firedac will change Updateoptions.Updatemode to upWhereAll. The following fields included in the clause WHERE may lead to error "no lines found"

it shows the properties you will have to disable to solve this problem.

  1. Providing correct unique identification columns;
  2. Disabling some fields with use WHERE excluding pfInWhere property TField.ProviderFlags correspondent ;
  3. Deleting these errors by configuring UpdateOptions.CountUpdatedRecords for False.

2

If that doesn’t solve. I think in this case, you could use an ini file instead of a table. Generally we use file . ini to store system parameters, is very effective.

  • 1

    More in these parameters have the password and e-mail account of the Customers...

0

Good morning, I went through this problem now, but a co-worker helped me solve.

What really happens in this situation is that he’s being "setate" only the primary key code, so to change the required field if it is not the primary key just select the "Tfdtable" and go into "Updateoptions > Updatemode > Put: upWhereChanged or upWhereAll" and you’ll solve what you need.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.