2,497
社区成员
发帖
与我相关
我的任务
分享
adoquery4.SQL.close;
adoquery4.SQL..clear;
adoquery4.SQL.add('insert into' + filename
+' values(''1'',' + FormatDateTime('yyyy/mm/dd dddd hh:nn:ss',Now()) + ',''108.5'')');
adoquery4.ExecSQL;
adoquery4.SQL.add('insert into' + filename
+' values(''1'',' + QuotedStr(FormatDateTime('yyyy/mm/dd hh:nn:ss',Now())) + ',''108.5'')');
procedure TForm1.Button1Click(Sender: TObject);
begin
AQ1.Close;
//方法1,自己处理引号
//AQ1.SQL.Text:='Insert Into T1(Num,OpDate)Values(1,'''+
// FormatDateTime('yyyy/MM/dd hh:mm:ss',Now)+''')';
//AQ1.ExecSQL;
//方法2,调用QuotedStr函数
AQ1.SQL.Text:='Insert Into T1(Num,OpDate)Values(''5'','+
QuotedStr(FormatDateTime('yyyy/MM/dd hh:mm:ss',Now))+')';
AQ1.ExecSQL;
end;
adoquery4.SQL.add('insert into' + filename
+' values(''1'',now(),''108.5'')');