delphi clientdataset open卡住了

TOMiscaifu 2017-04-18 10:31:11
str1 := 'select khmch,hyh,hh,bh,mxbh,gpjsrq,cf,sum(isnull(wtr,0)) as trzl ';
str1 :=str1+' from htyrerp01' + curgsbh +'..JHB_ztrjhysmx ';
str1 :=str1+' where (gsbh=''' + curgsbh + ''')';
if trim(Edit1.Text)<>'' then
str1:=str1+' and (gpjsrq>='''+Edit1.Text+''') ';
if trim(Edit2.Text)<>'' then
str1:=str1+' and (gpjsrq<='''+Edit2.Text+''') ';
if trim(Edit3.Text)<>'' then
str1:=str1+' and (rsjsrq>='''+Edit3.Text+''') ';
if trim(Edit4.Text)<>'' then
str1:=str1+' and (rsjsrq<='''+Edit4.Text+''') ';
if trim(Edit5.Text)<>'' then
str1:=str1+' and (a.khmch='''+Edit5.Text+''') ';
str1 := str1 + ' group by khmch,hyh,hh,bh,mxbh,gpjsrq,cf ';
query1.Close;
query1.CommandText := str1;
query1.Open;
query1.first;

调试到 query1.Open;卡住了,没有任何报错,程序死掉了,这是为什么,急求
...全文
477 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
santiaodahan 2017-04-18
  • 打赏
  • 举报
回复
没报错应该是没查询完。这SQL语句看起来比较耗时,输出SQL语句,在查询分析器里执行一下,看看有无错误,需要多长时间能出结果。

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧