请问EOleException如何使用,为什么程序出现EOleException未声明???
try
adoquery1.Close;
adoquery1.SQL.Clear;
sqlstr:='select * from test';
adoquery1.SQL.Add(sqlstr);
adoquery1.Open;
except
on EOleException do
showmessage('无法连接数据库');
end;
try
adoquery1.Close;
adoquery1.SQL.Clear;
sqlstr:='select * from test';
adoquery1.SQL.Add(sqlstr);
adoquery1.Open;
except
on EOleException do
showmessage('无法连接数据库');
end;
begin
try
Close;
SQL.Clear;
SQL.Add('select * from test ');
Open;
except
showmessage('无法连接数据库!');
end;
end;