adoquery2.Close; adoquery2.SQL.Clear;
adoquery2.SQL.Add('select * from employee where room=:room1 and dism_date=''');
adoquery2.Parameters.parambyname('room1').Value:=adoquery1.Fields[0].AsString;
if not adoquery2.Prepared then adoquery2.Prepared:=true;
adoquery2.Open;
錯誤:unclosed quotation before the character string
下面這條語句出錯:
adoquery2.SQL.Add('select * from employee where room=:room1 and dism_date=''');
dism_date 是datetime類型
這條語句怎麼寫?
adoquery2.SQL.Add('select * from employee where room=:room1 and dism_date=''');
adoquery2.Parameters.parambyname('room1').Value:=adoquery1.Fields[0].AsString;
if not adoquery2.Prepared then adoquery2.Prepared:=true;
adoquery2.Open;
錯誤:unclosed quotation before the character string
下面這條語句出錯:
adoquery2.SQL.Add('select * from employee where room=:room1 and dism_date=''');
dism_date 是datetime類型
這條語句怎麼寫?
解决方案 »
- delphi 转C# 大家给点意见
- 通过IP远程获取其他工作站主机名
- 文件的压缩速度很慢,如何优化(附代码)
- 请问各个xdjm一个问题,有没有这样一个报表控件,显示excel,不管它里面的内容是什么,不跟数据库相关,相关最好
- 请教,query的问题?
- 如何才能及时刷新啊??
- 指针及Tlist问题?
- ADO支持filteroptions吗?,please help me !!!!在ADOQUERY中如何filter中出现了filteroption are not supported?(
- 如何拦截TMainMenu的弹出事件?
- Application.CreateForm(TForm1,Form1)和Form1:=TForm1.Create(nil)有什么区别来着。
- 不好意思,问一个很菜很菜的问题(Socket)
- DBgrid问题请教?
+chr(39)+room1+chr(39)+' and dism_date='+chr(39)+''+chr(39)+');
adoquery2.sql.add('select * from employee where dism_date=isnull(dism_date,'')')
adoquery1.fields[0].asstring这一句只是获得第一个字段值.似乎没有什么意义
procedure TForm1.Button1Click(Sender: TObject);
var
room1:string;
begin
adoquery2.Close;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('select * from employee where room=:room1 and dism_date is Null');
adoquery2.Parameters.parambyname('room1').Value:=adoquery1.Fields[0].AsString;
if not adoquery2.Prepared then adoquery2.Prepared:=true;
adoquery2.Open;
showmessage(inttostr(adoquery2.RecordCount));end;
room1:string;这一句你不用管,我是调试程序时用了一下