我想在系统启动时检测一下ADOCONNECTION的连接情况,在登录窗口的确定按钮下,运行以下程序,却出现如下错误代码,不知何故.但此段代码如在一个ACTION下运行却没有问题.
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 004F9395 in module 'Project1.exe'. Read of address 00000058'. Process stopped. Use Step or Run to continue.
代码如下:
if (not dm.ADOConnection1.connected) then
begin
try
try
dm.adoconnection1.connectionstring:='FILE NAME=adoconn.udl';
dm.adoconnection1.connected:=true;
except
application.Terminate;
end;
finally
dm.ADOConnection1.Free;
end;
end
else
showmessage('ok!');
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 004F9395 in module 'Project1.exe'. Read of address 00000058'. Process stopped. Use Step or Run to continue.
代码如下:
if (not dm.ADOConnection1.connected) then
begin
try
try
dm.adoconnection1.connectionstring:='FILE NAME=adoconn.udl';
dm.adoconnection1.connected:=true;
except
application.Terminate;
end;
finally
dm.ADOConnection1.Free;
end;
end
else
showmessage('ok!');
解决方案 »
- 出错信息:invalid language driver!高分求教?
- d6 中indy 组件问题!
- 如何实现对窗口上一组同类的组件在程序中用数组表示?
- voc文件播放问题
- 能不能找到Delphi的QuickReport的帮助
- 急急急!哪里有地方下载Delphi读取foxpro for dos下的DBF库?
- 500元 请求哪位大侠彻底解决ACTIVEXFORM dax error Access Violation 问题
- 在客户机上用什么方法取得当前网络上的MSSQL服务器列表
- 我用DB2开发的一个数据库程序主控程序,有一张表专门记录用户上机使用情况当多个用户同时
- 再端上一盘关于Tsavedialog的菜
- 批处理的问题
- 需用您的帮助—软件测试(有偿)
Application.CreateForm(Tfrmmain, frmmain);
Application.CreateForm(Tdm, dm);
Application.CreateForm(Tfrmsplash, frmsplash);
frmsplash.Show;
frmsplash.l_msg.Caption:='正在连接数据库,请等待';
frmsplash.Update;
...