var
s1,s2,s3,sql3,Str_Result:string;
begin
Str_Result:='';
s1:=trim(Edit1.Text);
s2:=trim(Edit2.Text);
s3:=trim(Edit2.Text);
s3:=copy(s3,1,4);
sql3:='select 标题,摘要,来文单位,收到日期,文件字号,档号 from mfile';if (Length(Trim(Edit1.Text))<>0) then
Str_Result:=' where 标题 like '+'%'+s1+'%'; if (Length(Trim(Edit2.Text))<>0) then
begin
if Str_Result='' then
Str_Result:=' where 摘要 like '+'%'+s2+'%'
else
Str_Result:=Str_Result+' and 摘要 like '+'%'+s2+'%';
end; if (Length(Trim(Edit3.Text))<>0) then
begin
if Str_Result ='' then
Str_Result:=' where 日期='+s3+'%'
else
Str_Result:=Str_Result+' and 日期 like '+s3+'%';
end;
sql3:=sql3+Str_Result;
RunSQL(ADOQuery2,sql3,0);
s1,s2,s3,sql3,Str_Result:string;
begin
Str_Result:='';
s1:=trim(Edit1.Text);
s2:=trim(Edit2.Text);
s3:=trim(Edit2.Text);
s3:=copy(s3,1,4);
sql3:='select 标题,摘要,来文单位,收到日期,文件字号,档号 from mfile';if (Length(Trim(Edit1.Text))<>0) then
Str_Result:=' where 标题 like '+'%'+s1+'%'; if (Length(Trim(Edit2.Text))<>0) then
begin
if Str_Result='' then
Str_Result:=' where 摘要 like '+'%'+s2+'%'
else
Str_Result:=Str_Result+' and 摘要 like '+'%'+s2+'%';
end; if (Length(Trim(Edit3.Text))<>0) then
begin
if Str_Result ='' then
Str_Result:=' where 日期='+s3+'%'
else
Str_Result:=Str_Result+' and 日期 like '+s3+'%';
end;
sql3:=sql3+Str_Result;
RunSQL(ADOQuery2,sql3,0);
解决方案 »
- 怎样edit组件中输入的路径及文件名信息来创建文件?
- 救命!!连接Oracle问题,在线等!
- 菜鸟请教关于fastreport的简单使用
- 如果我不想使用timer组件,代码如何写?
- 怎么给一个EXCEL添加一张图表
- 望请指教无法安装DSPACK2.2的问题。
- 户口问题——严重提问!!!
- 好消息啊:Borland Delphi专业培训认证体系首次登陆中国
- 怎么让状态栏显示提示??
- Dear All:Do you happen to it?
- 通常大家开发数据库管理软件都用数据感知控件吗,我怎么感觉不是很灵活呢
- 请问,有两个文件流,A,B,现在B文件流是A文件流中的一部分,请问如果找到B文件流在A文件流的位置(也就是地址).例子如下
日期为日期/时间型
在DELPHI6中执行出现的错误如下
在三个文本框中无论输入哪个都报
[microsoft][ODBC Microsoft Access Driver]语法错误,在查询表达式'标题 lik %广东%'中
请高手给予帮助,提出正确的写法.
begin
if Str_Result='' then
Str_Result:=Format(' where 摘要 like ''%%%s%%''',[s2])
else
Str_Result:=Str_Result+Format(' and 摘要 like ''%%%s%%''',[s2]);
end; if (Length(Trim(Edit3.Text))<>0) then
begin
if Str_Result ='' then
Str_Result:=Format(' where 日期=#%s#',[s3])
else
Str_Result:=Str_Result+Format(' and 日期 like #%s#',[s3]);
end;