在Delphi7中使用ADO出现未知错误(附图),如何解决? (300分)

G

gxcooo

Unregistered / Unconfirmed
GUEST, unregistred user!
在Delphi7中使用TADOConnection时出现奇怪的错误,如图
http://kuga.51.net/temp/1.PNG
如何解决?
 
升级ADO,这种DLL出错,重装系统和DELPHI是可以解决的
 
看不见图片!
 
升级ADO,如果是自己的系统得太杂了(我就有一次),只有重装系统了。
 
ADO升级包
http://www.csdn.net/cnshare/soft/4/4541.shtm

试试看,对ADO来说都一样的
 
升级ADO试试,不行再重装DELPHI
 
98. Delphi中获得BDE、ADO的错误号
Delphi的数据库对象,如Ttable和TadoTable有以下一些Error事件:OnDeleteError、OnDeleteErro、OnPostError。这些事件的定义如下,都是数据集错误:
type TDataSetErrorEvent = procedure(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction) of object;
property OnPostError: TDataSetErrorEvent;

在这些事件在EdatabaseError中是无法得到错误号的,其中只有Message属性。在发生BDE错误时可如下得到错误号:
if E is EDBEngineError then
showmessage(inttostr(EDBEngineError(E).Errors[0].ErrorCode));
也可以这么写:
if E is EDBEngineError then
showmessage(inttostr((E As EDBEngineError).Errors[0].ErrorCode));
但在发生ADO错误时不能这样: E is EadoError。
其实Ado错误在数据集相应的数据库连接中都有:TadoConnection.Errors。
procedure TForm1.Table1PostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
var
i:integer;
begin
memo1.Lines.Add(inttostr(table1.Connection.errors.count ));
for i:=0 to AdoConnection1.errors.count-1 do
begin
memo1.Lines.Add('number:'+inttohex(AdoConnection1.errors.Number,8 ));
memo1.Lines.Add('NativeCode:'+inttostr(AdoConnection1.errors.NativeError ));
memo1.Lines.Add(inttostr(AdoConnection1.errors.HelpContext ));
memo1.Lines.Add(AdoConnection1.errors.Source );
memo1.Lines.Add(AdoConnection1.errors.SQLState );
memo1.Lines.Add('Description:'+AdoConnection1.errors.Description );
end;
memo1.Lines.Add('error Msg :'+e.message);
end;
NativeError是Foxpro的原生错误号,非常详细,一般用这个来判断发生的错误。Number是Sql错误号,是大的分类,一般一个Number和多个NativeError对应。
这些错误码的信息在文档Drvvfp.hlp中都有。

 
我用的D7啊,也要升级ADO?
 
重装系统,先装D7再装MSSQL2000解决问题
 
顶部