try adoconnection1.beginstran; do..... adoconnection.commitstran; except adoconnection1.rollbacktran; //显示错误 for I := 0 to adoconnection1.Errors.Count - 1 do begin case AParam.AConnection.Errors[I].NativeError of 547 : begin if pos('insert',AParam.AConnection.Errors[I].Description) > 0 then begin //'外键约束insert,delete,update'; if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + 's'; end else if pos('delete',AParam.AConnection.Errors[I].Description) > 0 then begin if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + 's'; end else if pos('update',AParam.AConnection.Errors[I].Description) > 0 then begin if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + 's'; end; end;//end of 547 945 : begin if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + '您的内存不足!'; end;//end of 945 4850 : begin if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + '数据库表被锁定!'; end;//end of 1204 2627 : begin if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + '输入的关键属性值已经存在!'; end;//end of 2627 7303 : begin if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + '网络初始化失败!请检查网络设置!'; end;//end of 7303 10024: begin if sErrText <> '' then sErrText := sErrText + #13; sErrText := sErrText + '网络连接超时!请检查网络设置!'; end;//end of 10024 else begin if end; end;//end of case end;//end of for //最后显示错误信息sErrText end; ______________ 做个调查,关于软件界面 http://expert.csdn.net/Expert/TopicView2.asp?id=1649010 谢谢关注
接分
接分
好来解决了,用notebook打开某个文件改了一个ADO有关的参数,具体现在忘了.
不知道大家有没碰到过?
try
adoconnection1.beginstran;
do.....
adoconnection.commitstran;
except
adoconnection1.rollbacktran; //显示错误
for I := 0 to adoconnection1.Errors.Count - 1 do
begin
case AParam.AConnection.Errors[I].NativeError of
547 : begin
if pos('insert',AParam.AConnection.Errors[I].Description) > 0 then
begin
//'外键约束insert,delete,update';
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + 's';
end
else
if pos('delete',AParam.AConnection.Errors[I].Description) > 0 then
begin
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + 's';
end
else
if pos('update',AParam.AConnection.Errors[I].Description) > 0 then
begin
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + 's';
end;
end;//end of 547 945 : begin
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + '您的内存不足!';
end;//end of 945 4850 : begin
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + '数据库表被锁定!';
end;//end of 1204 2627 : begin
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + '输入的关键属性值已经存在!';
end;//end of 2627 7303 : begin
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + '网络初始化失败!请检查网络设置!';
end;//end of 7303 10024: begin
if sErrText <> '' then sErrText := sErrText + #13;
sErrText := sErrText + '网络连接超时!请检查网络设置!';
end;//end of 10024 else begin
if
end;
end;//end of case end;//end of for
//最后显示错误信息sErrText
end;
______________
做个调查,关于软件界面
http://expert.csdn.net/Expert/TopicView2.asp?id=1649010
谢谢关注
用ADO时我碰到过一个BUG,一打开一个特定的窗体整个工程就自动退出了,
好来解决了,用notebook打开某个文件改了一个ADO有关的参数,具体现在忘了.
不知道大家有没碰到过?你的窗口上连接了数据库,而该数据库或数据表因为已经被删除即会出现以上问题,请回想你的数据连接情况将其恢复,这可能是BORLAND的BUG,避免的办法无论如何不要将ADOQUERY或ADOCONNECTION的ACTION属性设为TRUE,应该在运行时刻动态打开。