Board index » delphi » Identity field error
Jim
![]() Delphi Developer |
Identity field error2004-11-21 12:49:11 AM delphi174 I am using Delphi 7 and BDE to update/add records to a MS SQL 2000 table. This table has an identity field. My code is as follows: procedure TForm1.Button2Click(Sender: TObject); begin With Table1 do begin Open; Append; FieldbyName('TransNumbe').asInteger := 123; FieldbyName('AccountInd').asInteger := 456; FieldbyName('SubNumber').AsInteger := 1; FieldbyName('TransDate').AsDateTime := Date() + Time() ; FieldbyName('Operator').AsString := 'JWC'; //FieldbyName('eUnique').AsFloat := 1; post; end; end; If I execute this, I get an error "field eUnique must have a value. eUnique is my Identity field. If I uncomment the eUnique, I get an error "cannot insert explicit value for identity column when IDENTITY_INSERT is set to off. How can I get around this? Jim |