Cant trap Exception.



I have the folowing code (lConnection is a TADOConnection).
--------------------------------------------------------------
try
lConnection.Close;
lConnection.Open('','');
if lConnection.Connected then
begin
iRetVal := 1;
end;
except
iRetVal := 0;
end;
--------------------------------------------------------------

When this code is run, and I have disconnectet from my MSSQL server, I get a
message box with the following text (when running the "lConnection.Open"
line):
"Error: [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Specified SQL
server not found".

This message box appears both when the program is run from the IDE, and when
running outside the IDE. The problem is that the message box pops up even
when running the program outside the IDE. In my program, I cant have this
message box popping up, but I cant seem to catch this exception in code.

Any idea on how to catch this exception (removing the message box) ?

I am running:
Delphi 2007 (updates applied).
MS SQL server 2005


.



Relevant Pages

  • Re: Delphi 2005 update 1 is out!
    ... Delphi 2005 Update 1 Fixes ... When importing an assembly if the types Pointer or Exception are used ... bdpDataAdapter can cause the IDE to lose all key stroke events until ... Using a remote data module may cause an Access Violation. ...
    (borland.public.delphi.non-technical)
  • Re: Delphi Update one... are you serious?
    ... Delphi 2005 Update 1 Fixes ... When importing an assembly if the types Pointer or Exception are used ... bdpDataAdapter can cause the IDE to lose all key stroke events until ... Using a remote data module may cause an Access Violation. ...
    (borland.public.delphi.non-technical)
  • RE: Backup & Monitoring not working!
    ... Error message in Windows Small Business Server 2003: ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.windows.server.sbs)
  • Re: Sharepoint 2007 - Installation Error - Failed to register SP s
    ... Windows 2000 Server. ... It is a bug with Beta 2 where the database server is running Windows 2000. ... Server I have the following exception: ... RunBehavior runBehavior, String resetOptionsString) ...
    (microsoft.public.sharepoint.portalserver)
  • return from server only works for built-in types
    ... But when I call _r.GetStatisticsthe client fails with the exception shown ... GetStatistics fails when client and server is on different networks. ... Win32 Version: 2.0.50727.832 ...
    (microsoft.public.dotnet.framework.remoting)