case ComboBox2.ItemIndex of
0: sign:='=';
1: sign:='>';
2: sign:='<';
3: sign:=' like ';
4: sign:='<>';
end;
case ComboBox1.ItemIndex of
0,4:fstr:='select * from Book_Info where(%s%s%s) order by %s';
19: fstr:='select * from Book_Info where(%s%s#%s#) order by %s';
else fstr:='select * from Book_Info where(%s%s''%s'') order by %s';
end;
with ADOQuery1 do
begin
SQL.Clear;
SQL.Add(Format(fstr,[ComboBox1.Text,sign,Edit1.Text,ComboBox1.Text]));
Prepared;
Open;
end;
请问上段代码的意思!还有0,4和19分别是什么意思?三个WHERE后的又是什么意思?谢谢!
0: sign:='=';
1: sign:='>';
2: sign:='<';
3: sign:=' like ';
4: sign:='<>';
end;
case ComboBox1.ItemIndex of
0,4:fstr:='select * from Book_Info where(%s%s%s) order by %s';
19: fstr:='select * from Book_Info where(%s%s#%s#) order by %s';
else fstr:='select * from Book_Info where(%s%s''%s'') order by %s';
end;
with ADOQuery1 do
begin
SQL.Clear;
SQL.Add(Format(fstr,[ComboBox1.Text,sign,Edit1.Text,ComboBox1.Text]));
Prepared;
Open;
end;
请问上段代码的意思!还有0,4和19分别是什么意思?三个WHERE后的又是什么意思?谢谢!
解决方案 »
- 如何让label显示圆滑字体?
- delphi做平面游戏
- 如何根据数据库动态创建tabsheet
- Hint的问题:焦点在Dll中的窗体时,鼠标移动到控件上不会显示控件的Hint,但是焦点在Exe窗体上时,把鼠标放在Dll窗体中的控件上却能显示Hint.
- 进销存问题:如何对“客户付款期限”和“已过应收账时间”(比如过了期限15天、30天、60天、90天)进行预警?
- 各位大哥 DELPHI里导入导出原理是怎么样?
- 升四个三角,感谢大家支持!散。。。.
- 各位板主:折腾了我三天的问题还未解决。 delphi qreport
- 有谁知道,用了ClientDataSet的程序如何发布啊?
- 有一个网站开出的招聘信息很诱人哦,进来看看
- HELP
- 关于图像大小
where后面是打印用的格式化字符
WHERE指的是查询语句的限定条件...
就是这个样子..
看些基础的书.都有说的..
where后面是查詢語句用的格式化字符串。()
fstr:='select * from Book_Info where(%s%s%s) order by %s';
Format(fstr,[ComboBox1.Text,sign,Edit1.Text,ComboBox1.Text])
如果ComboBox2.ItemIndex =0
運行后Fstr:='select * from Book_Info where combobox1.Items[combobox1.ItemIndex]=Edit1.Text order by combobox1.Items[combobox1.ItemIndex]'