![]() |
|
#1
|
|||
|
|||
|
I have a delphi program with a form containing some dbedit objects.
The user of the form, enters some data and that data are saved in the database. Whenever i press the save button on my form i get the message "multiple records expected but only one found". After that, if i press the cancel button, the data are saved without any problem in the table! The table in mssql is something like that: field 1: id primary key (identity set to yes) field 2: date primary key .... various other fields. The form is using a counter (controled by delphi code) and the current date (see field2). All the other fields are entered manually. If i save the first data of the day (e.g 9/5/2012) i get no error message. When i save the second (date 9/5/2012 again) i get the error message. If i change the date to 10/5/2012 i get no error! So, if the date is unique there is no error. I don't really understand why that happens since date and id are combined to create a unique primary key. Any ideas? |
| Thread Tools | |
| Display Modes | |
|
|