标题:代码不知道
只看楼主
gulihuajhy
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-5-10
 问题点数:0 回复次数:0 
代码不知道

我不知道代码怎么写,写拉有问题,所以想请问个位大侠帮帮忙。
查询代码:procedure TForm1.Button6Click(Sender: TObject);
var
choice,content,SQLWhere:string;
begin
choice:=ComboBox1.text;
content:=edit1.text;
case ComboBox1.ItemIndex of
0:SQLWhere:='where'+'编号'+ content;
1:SQLWhere:='where'+'姓名'+ content;
2:SQLWhere:='where'+'性别'+ content;
3:SQLWhere:='where'+'单位部门'+ content;
4:SQLWhere:='where'+'住址'+ content;
5:SQLWhere:='where'+'类别'+ content;
end;
if content='' then
begin
Application.Messagebox('请输入查询内容!','提示',Mb_OK+Mb_iconinformation);
exit;
end;
Form1.ADOQuery1.Close;
Form1.ADOQuery1.SQL.clear;
Form1.ADOQuery1.SQL.add('select * from sydz where '+choice+'like :content');
Form1.ADOQuery1.Parameters.ParamByName('content').Value:='%+edit1.text+'%';
Form1.ADOQuery1.Open;
end;
但不知道为什么运行起来没问题但一查询就不行拉,还有的代码我就不会拉。
我是用SQL+Delphi7.0做的,谢谢!
搜索更多相关主题的帖子: 代码 
2006-05-23 09:18



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-66396-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017890 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved