With dm1. Qry_cj do
The begin
Dm1. Qry_cj. Close;
Dm1. Qry_cj. SQL. The Clear;
Dm1. Qry_cj. SQL. The Add (' insert into chengji ([kshibianhao], [kshbianhao]) values (kshibh KSHBH) ');
Dm1. Qry_cj. ExecSQL;
end;
CodePudding user response:
Var
Param: TParameter;
.
SQL. The Clear;
SQL. Text:="INSERT INTO ChengJi ([kShiBianHao], [kShBianHao]) VALUES (kshibh, : KSHBH) ';
Param:=the Parameters ParamByName (' kshibh ');
Param. DataType:=ftInteger;//assumptions are integers;
Param. Value:=10010;//set the field value here,
.
//can (just flawed) as follows:
SQL. The Clear;
SQL. Text:=Format (' INSERT INTO ChengJi ([kShiBianHao], [kShBianHao]) VALUES (% d, % d) ', [kshibh KSHBH]));
ExecSQL;
CodePudding user response:
Upstairs right, can also be debugged in the SQL statement, into the statementHave quote field is plus
CodePudding user response:
Obvious grammatical errorsWith dm1. Qry_cj do
The begin
Dm1. Qry_cj. Close;
Dm1. Qry_cj. SQL. The Clear;
Dm1. Qry_cj. SQL. The Add (' insert into chengji ([' + kshibianhao +], [' + kshbianhao + ']) values (kshibh KSHBH) ');
Dm1. Qry_cj. ExecSQL;
end;
Kshibianhao is integer series, plus IntToStr (kshibianhao)
Dm1. Qry_cj. SQL. The Add (' insert into chengji ([' + IntToStr (kshibianhao) + '], [' + IntToStr (kshbianhao) + ']) values (kshibh KSHBH) ');