用ADO连接数据库,如何捕获连接失败的错误!如何处理。
解决方案 »
- Canvas.Brush.Bitmap := mybgpic 传的是指针还是?
- dephi是我们一辈子的依靠吗?
- dbchart里的series1和series2可以对应不同的表格吗?在运行时显示两条不同的曲线?
- 当Tadoquery 组件的sql中有参数为时间的时候,如何设置时间的值(除了通过string之外)?
- delphi 如何调用cad2000绘制的工程图?
- 关于DBgrid的问题!
- 怎么将选定的子窗口设置为活动的子窗口:如要将MDIChildren[5]设置为活动的???
- 我在一个Panel(PanelPic)上自动生成了一些TRadiobutton,我想全部删除,怎么写?
- 请问ISO文件如何安装
- 简单问题?
- 不同的ORACLE驱动程序对存储或读取TBlobField有不同的影响?欢迎讨论
- 使用BDE(dataset,table)访问SQL中表的问题。。。
..
else
..
Error = interface(IDispatch)
['{00000500-0000-0010-8000-00AA006D2EA4}']
function Get_Number: Integer; safecall;
function Get_Source: WideString; safecall;
function Get_Description: WideString; safecall;
function Get_HelpFile: WideString; safecall;
function Get_HelpContext: Integer; safecall;
function Get_SQLState: WideString; safecall;
function Get_NativeError: Integer; safecall;
property Number: Integer read Get_Number;
property Source: WideString read Get_Source;
property Description: WideString read Get_Description;
property HelpFile: WideString read Get_HelpFile;
property HelpContext: Integer read Get_HelpContext;
property SQLState: WideString read Get_SQLState;
property NativeError: Integer read Get_NativeError;还有事件状态:TEventStatus
//连接数据库
except
on E:EOleException do
begin
//异常
end;
adotable1.connection
except on E:EOleException do
begin
//处理
end;
begin
end就是这样捕获特定的数据库异常!!
ADOConnection1.Connected
execpt on EDataBaseError do
showmessage('数据库链接错误');
end;