with qry2 do
The begin
The Close;
SQL. The Clear;
SQL. The Add (+ cbb7 'update'. The 'set' Text + + dbgrdh2. Columns [cbb7. ItemIndex + 1] '=' FieldName + + trim (rzedit2. Text) + 'where s_name=' "+ trim (rzedit1. Text) +" '");
//Parameters. ParamByName (dbgrdh2. Columns [cbb7. ItemIndex + 1] FieldName). The Value:=trim (rzedit2. Text);
ExecSQL;
//update test set ldt_score='2.19' where s_name='Fan Zheming' this code in the query parser implementation success
RzButton1. Click;
Rzedit2. Text:=' ';
Your good friend, help me!!!!!!!!!!!
CodePudding user response:
With a dataset doThe begin
post;
next;
If eof then
last;
Edit. Setfocus;
end;
More than just thinking
CodePudding user response:
1, the use of SQL statements to update data bank,2, after the update, through Next to the Next line,
Repeat 1 and 2, 3
CodePudding user response:
Reference code:
Procedure TForm1. Edit1KeyDown (Sender: TObject; Var Key Word;
Shift: TShiftState);
The begin
If (Key=13) then
The begin
With ADOQuery2 do
The begin
The close;
SQL. Text:='select * from DrawLine where lineid=' + edit2. Text + ';
The Open;
Edit;
FieldByName (' LinePenColor). AsInteger:=StrToInt (edit1. Text);
Post;
end;
If ADOQuery1. RecNo=ADOQuery1. RecordCount then
The begin
//ShowMessage (' last line);
End
The else
The begin
ADOQuery1. RecNo:=ADOQuery1. RecNo + 1;
Edit1. Text:=DBGrid1. The DataSource. The DataSet. FieldByName (' LinePenColor). AsString;
Edit2. Text:=DBGrid1. The DataSource. The DataSet. FieldByName (" LineID "). The AsString;
The end;
//ADOQuery1. DisableControls;
//ADOQuery1. Refresh;
//ADOQuery1. EnableControls;
Edit1. SetFocus;
Edit1. SelectAll;
ADOQuery1. Refresh;
end;
end;
CodePudding user response:
SQL statements to update data bank, and then nextCodePudding user response: