Home > database >  Help: Delphi SQL2008 when data: not in a position to update rows. Some values may have changed since
Help: Delphi SQL2008 when data: not in a position to update rows. Some values may have changed since

Time:11-23




What a great god can help me have a look at what is going wrong?
The database table has a primary key, and more than one entry, there is no problem, at the same time operating is wrong...

Procedure TF_beneficiary. Button1Click (Sender: TObject);
The begin
If ((Edit1. Text<> ") and (Edit2. Text<> ") and (Edit3. Text<> ") and (Edit4. Text<> ") and (Edit6. Text<> ") and (Combobox1. Text<> ") and (Combobox1. Text<> ") and (Combobox4. Text<> "')) then
The begin
If change=true then
The begin

Mydm. Benesrc. DataSet. Bookmark:=Mybookmark;
Mydm. Benesrc. DataSet. Delete;
end;
With Mydm. BeneQuery do
The begin
The Close;
With SQL do
The begin
The Clear;
Add (" insert into beneficiary values (: : p0, p1, p2, : p3, : p4, : p5, : p6, : p7, : p8, : p9) ');
end;
The Parameters [0]. Value:=datetimepicker1. Date;
The Parameters [1]. The Value:=Trim (edit1. Text);
The Parameters [2]. The Value:=Trim (edit2. Text);
The Parameters [3]. The value:=Trim (edit3. Text);
The Parameters [4]. The value:=Trim (edit4. Text);
The Parameters [5]. The Value:=Trim (Combobox4. Text);
The Parameters [6]. The Value:=Trim (edit6. Text);
The Parameters [7]. The Value:=Trim (Combobox1. Text);
The Parameters [8]. Value:=Trim (Combobox2. Text);
The Parameters [9]. Value:=Trim (memo1. Lines. The Text).
Execsql;
end;
With Mydm. BeneQuery do
The begin
The Close;
With SQL do
The begin
The Clear;
Add (' select * from beneficiary ");
end;
The Open;
end;
F_customer. Guo:=(strtoint (trim (Mydm. Guosrc. DataSet. FieldByName (' saveguo). AsString) are identical));
Inc (F_customer. Guo);
Mydm. Guo. Edit;
If change<> True then
Mydm. Guosrc. DataSet. FieldByName (' saveguo). AsString:=Trim (inttostr (F_customer. Guo));
MYdm. Guo. Post;
Change:=false;
Button2. Click;
Speedbutton7. Enabled:=True;
End
The else
The begin
Application. MessageBox (' input the necessary information, 'and' prompt ', 64);
exit;
end;
Speedbutton1. Enabled:=true;
Speedbutton2. Enabled:=true;
For the Enabled:=false;
Button2. Enabled:=false;
end;

CodePudding user response:

Tried many ways are not online...
  • Related