具体问题如下:
公共函数:
function jczf(sql_str:strin):integer;
begin
with pub.qjc do
begin
close;
sql.clear;
sql.add(sql_str);
try
open;
if recordcount>0 then
result:=0 else result:=-1;
except
result:=-1;
raise;
end;
end;
end;在软件应用中调用函数(通过一个edit或button控件--回车)如下:
if jczf('select * from information where code=''if_yjk_zd'' and set_value=''1'' ')=0 then
begin
...............
end;
就会提示错误信息如下:(通过一个edit或button控件--回车之后会出现)
QJC:cannot perform this operation on an open datset
好像是不能怎样一个打开的数据????不知是咋个搞的有时又出现有时又不出现好像很不稳定!
然后退出系统的时候也有错误提示但是如果没有上面的错误提示信息退出时也不会出现错误提示信息如下:
Application Error Exception EdatabaseError in module Vcldb50.bpl at 0008df0 QJC:cannot Perform this operation on an open dataset不知何故望高手指点我想了好长时间也没有想出来哎呀!!!!
公共函数:
function jczf(sql_str:strin):integer;
begin
with pub.qjc do
begin
close;
sql.clear;
sql.add(sql_str);
try
open;
if recordcount>0 then
result:=0 else result:=-1;
except
result:=-1;
raise;
end;
end;
end;在软件应用中调用函数(通过一个edit或button控件--回车)如下:
if jczf('select * from information where code=''if_yjk_zd'' and set_value=''1'' ')=0 then
begin
...............
end;
就会提示错误信息如下:(通过一个edit或button控件--回车之后会出现)
QJC:cannot perform this operation on an open datset
好像是不能怎样一个打开的数据????不知是咋个搞的有时又出现有时又不出现好像很不稳定!
然后退出系统的时候也有错误提示但是如果没有上面的错误提示信息退出时也不会出现错误提示信息如下:
Application Error Exception EdatabaseError in module Vcldb50.bpl at 0008df0 QJC:cannot Perform this operation on an open dataset不知何故望高手指点我想了好长时间也没有想出来哎呀!!!!
解决方案 »
- 关于Delphi托盘问题(主Form中调用其他Form后托盘遇到问题)
- adoquery的问题
- 如何在Access数据库中添加一个表?
- MIDAS 用socketconnction连接中间层老是死掉,为什么?怎么解决?
- 有关数据类型转换的小问题,帮着看看。
- 关于hint的问题:我在写mdi程序时对主表单的SHOWHINTS设为TRUE了,但是不知为何在表单的工具栏上的HINT就是无法显示?不知为何?
- 简单adoquery问题,送分,反正我分多。
- ip协议的问题
- DELPHI做的ACTIVE FORM 控件
- 怎样让TImage响应键盘的消息如何用上下键来移动TImage?
- 如何能一个MDB文件不用直接用ACCESS程序打开
- 求html转换为text的方法
换成ACCESS数据库
Adoconnection.Close;
Adoconnection.Open;
using : boolean;function jczf(sql_str:strin):integer;
begin
if pub.using then
begin
ShowMessage('函数使用中');
Reult := -2;
Exit;
end;Pub.Using := true;
try
with pub.qjc do
begin
close;
sql.clear;
sql.add(sql_str);
try
open;
if recordcount>0 then
result:=0 else result:=-1;
except
result:=-1;
raise;
end;
end;
finally
pub.using := false
end;
end;
end;
function jczf(sql_str:strin):integer;
begin
with pub.qjc do
begin
close;
sql.clear;
sql.add(sql_str);
try
open;
if recordcount>0 then
result:=0 else result:=-1;
except
result:=-1;
raise;
end;
end;
end;
是关闭了又打开的呀是不???close;
这是dataset的状态问题。跟DELPHI没关系。不要乱戴帽子。