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;难道一定要用参数吗?
不用参数的话该怎么改?
各位帮帮忙啦
解决方案 »
- 为什么就是delphi论坛进入,提示[公告]CSDN 论坛升级通知.
- delphi 中Ado 如何传带表名的字段(tb1.col1)。
- ADOTable LookUo方法
- chart 的x坐标是日期,当鼠标移动时怎么得到x坐标的值 ?
- 怎样让我的窗口在最小化后浮在上面?
- 请问为什么adoStoreProc中执行时出现'在SQL语句结尾出现字符。,'的提示?
- 散分,马上结
- 一个字窗体关闭的问题,高手请进
- idtcpserver主动断开与idtcpclient的连接,客户端怎么又连上去?
- 我为什么收不到sendmessage发给我的消息?
- 急问:储存过程导入导出数据库问题,无法打开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+''''