DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: jeff1314
今日帖子: 16
在线用户: 11
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 zxc1998 (zxc1998) ★☆☆☆☆ -
普通会员
2004/3/16 16:28:54
标题:
大侠帮我看一下 浏览:903
加入我的收藏
楼主: procedure TForm1.Button1Click(Sender: TObject);
begin
adoquery1.Active:=true;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.add('select ss_dtype,fixlen from spt_provider_types');
case combobox2.Text of
'大于':begin
adoquery1.sql.Add('where combobox1.text>'+edit1.text);
adoquery1.Prepared;
adoquery1.ExecSQL;
adoquery1.Open;
end;
'小于':begin
adoquery1.sql.Add('where combobox1.text='+edit1.text);
adoquery1.Prepared;
adoquery1.ExecSQL;
adoquery1.Open;
end;
else
begin
adoquery1.sql.Add('where combobox1.text='+edit1.text);
adoquery1.Prepared;
adoquery1.ExecSQL;
adoquery1.Open;
end;
end;
end;
错误信息:
[Error] DATA1.pas(55): Ordinal type required
[Error] DATA1.pas(56): Incompatible types: 'Integer' and 'String'
[Error] DATA1.pas(62): Incompatible types: 'Integer' and 'String'
[Error] DATA1.pas(79): Statement expected but 'PROCEDURE' found
[Fatal Error] DATA.dpr(5): Could not compile used unit 'DATA1.pas'
请各位大侠指点指点,错在哪里,感激不尽!!!!
我是一只菜鸟,但是也想飞.
----------------------------------------------
-
作者:
男 zizii (高高高级馒头) ★☆☆☆☆ -
神秘会员
2004/3/16 16:42:51
1楼: case combobox2.Text of
^^^^^^^^^^^^^^^^^^^^^^^
察看Case的用法,Case不能Of字符串,只能是
Case ... Of
0://
1://
end;
----------------------------------------------
维护世界和平,共创美好盒子。
作者:
男 zxc1998 (zxc1998) ★☆☆☆☆ -
普通会员
2004/3/16 17:07:59
2楼: 但是,我这样也不行.请指教!!!!!!
procedure TForm1.Button1Click(Sender: TObject);
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.add('select hi from ch');
if combobox2.Text='大于' then
begin
adoquery1.sql.Add('where "combobox1.text">'+edit1.text);
adoquery1.Prepared;
adoquery1.Open;
end
else
if combobox2.text='等于' then
begin
adoquery1.sql.Add('where combobox1.text='+edit1.text);
adoquery1.Prepared;
adoquery1.ExecSQL;
adoquery1.Open;
end
else
if combobox2.text='小于'then
begin
adoquery1.sql.Add('where "combobox1.text"<'+edit1.text);
adoquery1.Prepared;
adoquery1.ExecSQL;
adoquery1.Open;
end;
end;
end.
感激不尽!!!!!!
----------------------------------------------
-
作者:
男 xjr888 (arming) ★☆☆☆☆ -
盒子活跃会员
2004/3/16 17:14:23
3楼: 你编程序的语句格式要规范一下,不然很难判断 begin end 是否成对了
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行1011.719毫秒 RSS