In form1.setupForm() I have the following code which should close the application if there are any problems with connecting to the database.
For some reason it just ignores the application.Terminate. Please can someone help.
try
database1.Open;
except
on E:EDBEngineError do
begin
Application.MessageBox('Error connecting','Error',0);
Application.Terminate;
end;