Do you get an exception code (and not the exception you want) when you run it from the IDE, and also when run directly from your executable? The reason I'm asking is because the IDE will report an error / exception first, and if you don't continue, you will never see the actual exeception trap.
IDE , . , , , Delphi.
, , , , , , , . , , , , , .
try
CDS.CommandText := 'SELECT * FROM tablename WHERE fieldname = 1';
CDS.Open
except
on E: Exception do begin
ShowMessage(E.Message);
// optionally Exit, Abort or what else, to stop execution of the next statements
end;
end;