代码如下:
With ADOQuery1 Do
BEgin
Close;
SQL.Clear;
SQL.Add('update tUser set iUn=1,dtime1='1899-12-30 02:00:00',dtime2='1899-12-30 08:00:00' where scardid='''+Form1.Edit2.Text+''''');
execSQL;
end;
报:[错误]Unit1.pas(86): missing operator or semicolon
请问这是怎么回事的?
我是新手..
With ADOQuery1 Do
BEgin
Close;
SQL.Clear;
SQL.Add('update tUser set iUn=1,dtime1='1899-12-30 02:00:00',dtime2='1899-12-30 08:00:00' where scardid='''+Form1.Edit2.Text+''''');
execSQL;
end;
报:[错误]Unit1.pas(86): missing operator or semicolon
请问这是怎么回事的?
我是新手..
改成
SQL.Add('update tUser set iUn=1,dtime1='''1899-12-30 02:00:00''',dtime2='''1899-12-30 08:00:00''' where scardid='''+Form1.Edit2.Text+''''');
使用这个还是一样的报错...汗....
set iUn=1,
dtime1=to_date(''1899-12-30 02:00:00'',''RRRR-MM-DD HH24:MI:SS''),
dtime2=to_date(''1899-12-30 08:00:00'',''RRRR-MM-DD HH24:MI:SS''
where scardid='''+Form1.Edit2.Text+'''');
记得结帖给分,谢谢!
set iUn=1,
dtime1=to_date(''1899-12-30 02:00:00'',''RRRR-MM-DD HH24:MI:SS''),
dtime2=to_date(''1899-12-30 08:00:00'',''RRRR-MM-DD HH24:MI:SS'')
where scardid='''+Form1.Edit2.Text+'''');
少了个括号……
检测到错误类:E0leException,错误信息:''to_date'不是可以识别的函数名,进程中止,
BEgin
Close;
SQL.Clear;
SQL.Add('update tUser set iUn=1,dtime1='+''''+'1899-12-30 02:00:00'+''''+',dtime2='+''''+'1899-12-30 08:00:00'+''''+' where scardid='+''''+Form1.Edit2.Text+'''');
execSQL;
end;
我用的是 Oracle 数据库,你的不是……
抱歉,这个是习惯性思维,我考虑太少了。其实,你的错误在于这里(三楼)——scardid='''+Form1.Edit2.Text+''''');
多了一个',应该是四个,而你写了五个。