程序没有响应(0分)

  • 主题发起人 主题发起人 snow_white
  • 开始时间 开始时间
S

snow_white

Unregistered / Unconfirmed
GUEST, unregistred user!
我用pardox作数据库
在查询数据的时候经常会出现
(现有数据350条)
程序没有响应
 
把代码贴出来!
 
if not dm.qpro.Active=true then dm.qpro.active:=true;
try
dm.qpro.Locate('pro_code',edit1.text,[loCaseInsensitive,lopartialkey]);
except
showmessage('没有查到该数据');
end;
 
不对吧,你这样做除非你的查询出了异常,否则是不会看到提示信息的。你可以这样做:
try
if not dm.qpro.Active=true then dm.qpro.active:=true;
if not dm.qpro.Locate('pro_code',edit1.text,[loCaseInsensitive,lopartialkey]) then
showmessage('没有查到该数据');
except
showmessage('数据库错误');
end;
 
我试过了,现在是这样的问题
try
if not dm.qpro.Active=true then dm.qpro.active:=true;
//******************************************************
if not dm.qpro.Locate('pro_code',edit1.text,[loCaseInsensitive,lopartialkey]) then
// 单步调试,运行到这句时程序没有响应,也没有错误提示,去掉locaseinsensitive正常,这是为何?
//中段程序后,再次运行程序无法运行,然后无法正常退出delphi5.0
//强行关闭,在进入程序,可启动程序,程序运行到这句时出错
//**************************************************************
showmessage('没有查到该数据');
except
showmessage('数据库错误');
end;

 
[8D]
关注!
能不能将问题说清楚些?
 
接受答案了.
 
后退
顶部