DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: snarv
今日帖子: 12
在线用户: 9
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 mingyifan (mm) ★☆☆☆☆ -
盒子活跃会员
2004/4/22 10:11:32
标题:
请大家看错在哪儿 浏览:1436
加入我的收藏
楼主: procedure Tzj_tj2_jxjy.BitBtn1Click(Sender: TObject);
var
a:integer;
str1:string;
str2:string;
begin
if datetimepicker1.Date >datetimepicker2.Date then
showmessage('开始时间大于结束时间,请重新设置开始时间!');
end
else
begin
str1:=copy(datetostr(datetimepicker1.Date),1,4);
str2:=copy(datetostr(datetimepicker2.Date),1,4);
end;

with q_jxjy do
begin
f1book1.ClearRange(-1,-1,1,1,f1clearall);
f1book1.TextRC[1,1]:='工 号';
f1book1.TextRC[1,2]:='姓 名';
f1book1.TextRC[1,3]:='性 别';
f1book1.TextRC[1,4]:='总学时';
f1book1.TextRC[1,5]:='岗位名称';
f1book1.TextRC[1,6]:='部门名称';


close;
sql.clear;
sql.Add('select * from userid.zj_jxjyxxb where nf>=str1 and nf<=str2 and pass=1');
open;

a:=2;
while not eof do
begin
f1book1.TextRC[a,1]:=fieldbyname('gh').asstring;
f1book1.TextRC[a,2]:=fieldbyname('xm').asstring;
f1book1.TextRC[a,3]:=fieldbyname('xb').asstring;
f1book1.TextRC[a,4]:=fieldbyname('xs').asstring;
f1book1.TextRC[a,5]:=fieldbyname('gwmc').asstring;
f1book1.TextRC[a,6]:=fieldbyname('bmmc').asstring;
a:=a+1;
next;
end;
end
end;


procedure Tzj_tj2_jxjy.BitBtn3Click(Sender: TObject
----------------------------------------------
-
作者:
男 12521052 (混世生) ★☆☆☆☆ -
盒子活跃会员
2004/4/22 10:38:12
1楼: 出錯行和出錯提示
----------------------------------------------
——混世生
作者:
男 jasonmao (jason) ★☆☆☆☆ -
普通会员
2004/4/22 12:02:29
2楼: sql.Add('select * from userid.zj_jxjyxxb where nf>=str1 and nf<=str2 and pass=1');
变量要用引号引起来。
----------------------------------------------
我真的很菜啊。
作者:
男 dfw@159095 (赵抄) ★☆☆☆☆ -
普通会员
2004/4/22 12:30:24
3楼: sql.Add('select * from userid.zj_jxjyxxb where nf>=str1 and nf<=str2 and pass=1');

改为
sql.Add(Format('select * from userid.zj_jxjyxxb where nf>=%s and nf<=%s and pass=1',[str1,str2]));

----------------------------------------------
我是男儿当自强
作者:
男 mudian (mudian) ★☆☆☆☆ -
普通会员
2004/4/22 14:02:26
4楼: sql.Add('select * from userid.zj_jxjyxxb where nf>=str1 and nf<=str2 and pass=1');
改为:
sql.Add('select * from userid.zj_jxjyxxb where nf>= ' + str1 + ' and nf<=' + str2 + ' and pass=1');

----------------------------------------------
依然记得从你口中说出再见坚强如铁 
昏暗中有种烈日灼伤的错觉 
黄昏的地平线 
画出一句离别 
爱情进入永夜 
依然记得从你眼中滑落的泪伤心欲决 
混乱中有种烈日灼伤的错觉 
黄昏的地平线 
割断幸福喜悦 
相爱已经幻灭
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行70.3125毫秒 RSS