adoquery1.sql.text:='update table1 set trans_time=(), trans_date=() where id=j';
j是程序中的变量 int类型 trans_time trans_date为字符类型 都是现在的时间和日期
格式为 xx:xx:xx xxxx-xx-xx 另外id也是整形的请补充完整
j是程序中的变量 int类型 trans_time trans_date为字符类型 都是现在的时间和日期
格式为 xx:xx:xx xxxx-xx-xx 另外id也是整形的请补充完整
解决方案 »
- 如何读取其他程序密码框中的密码?
- dll里面显示的模式窗口关闭以后的问题!
- Access密码忘记了怎么办
- 怎样选择多列作为主键(PrimaryKey)
- 安装ehlib的问题。。。。
- 小问题,请求帮助
- hjd_cw请进来领分
- 很弱的问题,但我不知道....
- 请问如何用代码得到桌面上任一图标的文本内容,不知道ListView_GetItemText这么用????
- 紧急求救:quickrep中列数太多,preview只能看到A4页面宽度的内容,即使更改ORIENTATION为LANDSCAPE也不行。注:我的计算机上没有安装打印机。
- 如何根据一个变量值来生成一组数字??
- 请教:如何将excel表中数据导入到oracle表?
nowtime,nowdate:string;
begin
nowtime:=formatdatetime('hh-mm-ss',now);
nowdate:=formatdatetime('yyyy-mm-dd',now); ......
end
用参数传递比较好
begin
Close;
Sql.text := ' update table1 set trans_time=:trans_time,trans_date=:trans_date where id=:id';
Parameters.ParamByName('trnas_time').value := formatdatetime('hh:mm:ss',now);
Parameters.ParamByName('trnas_date').value := formatdatetime('yyyy-mm-dd',now);
Parameters.ParamByName('id').value := j;
ExecSql;
end;
adoquery1.sql.text:=format('update table1 set trans_time=''s%'',trans_date=''s%'' where id=%d',[formatdatetime('hh:mm:ss',now),formatdatetime('yyyy-mm-dd',now),j ]);