主题:Delphi 编译时遇到的一个问题,急!!! 求帮助。
eliotjiajia
[专家分:10] 发布于 2006-11-07 18:27:00
procedure TDM.DataModuleCreate(Sender: TObject);
conn.ConnectionString := '一些连接信息';
try
conn.Open;
except
on Err : EOleException do
begin
//做一些处理
end;
end;
end;
程序无法通过编译:错误提示是
[Error] DBModule.pas(37): Undeclared identifier: 'EOleException'
当我去掉 on Err: EOleException do 时,尝试conn.ConnectionString 录入错误的信息并登录,调试时又引发异常类EOleException..
我不想用‘Exception’代替‘EOleException’!!!
请问各位要怎样解决这个问题?
回复列表 (共4个回复)
沙发
mercuryxu [专家分:240] 发布于 2006-11-08 15:46:00
Undeclared identifier: 'EOleException' 没有定义...你试下在前面定义看看.
板凳
kinglion823 [专家分:0] 发布于 2007-04-28 16:08:00
XIAN YONG var DENG YI YI XIA
3 楼
aizaixiiii [专家分:2130] 发布于 2007-04-29 08:58:00
EOleException is the exception class for OLE automation errors that occur in methods or properties of an object.
Unit
ComObj
Description
EOleException is the exception class for errors specific to the OLE IDispatch interface. EOleException is raised when an error occurs in the middle of a method call from IDispatch. EOleException is generated when a Delphi server receives a failure return value from a property or method that was called with the IDispatch interface Invoke method.
When an error occurs, objects invoked through IDispatch can return essential information about the exception, including the source of the error, error code, description, help file, and ID number for context-sensitive help. EOleException captures this information, and the error description and ID number (if available) are included in a message generated by CreateHelp; the other information is stored in the Source and HelpFile properties defined for EOleException and the ErrorCode property inherited from EOleSysError.
看一下DELPHI的帮助就知道了。
4 楼
jingling953 [专家分:40] 发布于 2007-04-30 13:29:00
3楼你说的只是发生异常的现象,你能不能说说解决方法啊?
我也是初学者,也经常碰到一些类似的问题,还请你不吝赐教!!谢谢
我来回复