var
s,s1,s2,s3,s4:string;
value1,value2:string;
begin
s:='select * from house where 交易类型=买卖';
s1:='';
s2:='';
s3:='';
s4:='';
if combobox10.text<>'房屋用途' then
begin
s1:=combobox10.text;
s:=s+'and 房屋用途='''+s1+'''';
end;
if combobox11.text<>'层次' then
begin
s2:=combobox11.text;
s:=s+'and 房屋用途='''+s2+'''';
end;
if combobox12.text<>'房型' then
begin
s3:=combobox12.text;
value1:=copy(s3,0,1);
value2:=copy(s3,4,1);s:=s+'and 房型室='''+value1+'''and 房型厅='''+value2+''' ';
end;
if combobox13.text<>'房屋类型' then
begin
s4:=combobox13.text;
s:=s+'and 房屋类型='''+s4+'''';
end;
with datamodule3.ADOQuery1 do
begin
close;
sql.clear;
sql.add(s);
open;
end;
end;提示错误: 参数不足,期待是1;难道一定要用参数吗?
不用参数的话该怎么改?
各位帮帮忙啦
s,s1,s2,s3,s4:string;
value1,value2:string;
begin
s:='select * from house where 交易类型=买卖';
s1:='';
s2:='';
s3:='';
s4:='';
if combobox10.text<>'房屋用途' then
begin
s1:=combobox10.text;
s:=s+'and 房屋用途='''+s1+'''';
end;
if combobox11.text<>'层次' then
begin
s2:=combobox11.text;
s:=s+'and 房屋用途='''+s2+'''';
end;
if combobox12.text<>'房型' then
begin
s3:=combobox12.text;
value1:=copy(s3,0,1);
value2:=copy(s3,4,1);s:=s+'and 房型室='''+value1+'''and 房型厅='''+value2+''' ';
end;
if combobox13.text<>'房屋类型' then
begin
s4:=combobox13.text;
s:=s+'and 房屋类型='''+s4+'''';
end;
with datamodule3.ADOQuery1 do
begin
close;
sql.clear;
sql.add(s);
open;
end;
end;提示错误: 参数不足,期待是1;难道一定要用参数吗?
不用参数的话该怎么改?
各位帮帮忙啦
解决方案 »
- 自定义的过程放类中使用会报错,直接放form中正常。
- 字符串问题
- 如何将多个exe程序合并到一个exe程序里边,并且运行后能释放到不同的目录的!
- TList能释放所有类型的对象吗?
- 求Delphi5.0安装文件
- 我现在用GRID显示了一个A字段,我要在A字段后加多一个B字段是对应的名字,这个字段是另外一个表的
- 急救!!! .DCU文件被删除掉
- 文件的加密问题求助!
- 如何对Tadoquery查询的结果集的某个字段进行修改??????????????
- delphi在网页上上传成固定图片代码怎么写
- 急问:储存过程导入导出数据库问题,无法打开BCP主数据库文件?在线等待
- 那位高手能帮我看看这段用WPE抓到的数据包!
s1:='';
s2:='';
s3:='';
s4:='';
if combobox10.text<>'房屋用途' then
begin
s1:=combobox10.text;
s:=s+'and 房屋用途='''+s1+''''
\\我觉得是你的语句有问题
比如有些地方应该有个空格隔开的,你忽略了
如:
'select * from house where 交易类型=买卖'+'and 房屋用途='''+s1+''''
就变为:
select * from house where 交易类型=买卖and 房屋用途//
很明显,“买卖”和“and”之间应该有个空格
所以
s:=s+'and 房屋用途='''+s1+''''应该是
s:=s+' and 房屋用途='''+s1+''''