uses BDE;
var
I:Integer;
begin
try
Database.Open;
except
on E:<B>EDBEngineError</B>do
with Edo
for I:=0 to ErrorCount-1do
with Errorsdo
<font color=red> if (Category=ErrCat_Other) and //错误种类=ErrCat_Other,51 Miscellaneous
(SubCode=ErrCode_UnknownSQL) then
//SubCode=ErrCode_UnknownSQL,3 Unknown SQL error
case NativeError of //Database Server返回的错误值
-902: raise Exception.Create('用户名或口令错')
-904: raise Exception.Create('Interbase Server未运行');
end;
</font>
end;
end;
When you start a program using Local InterBase Server with BDE, it will start automatically, after you close your program, it closes too.
You needn't to start manually.