Cant trap Exception.
- From: "Karl A. Sørensen" <kas@[REM]kamstrup-ems.no>
- Date: Tue, 19 Feb 2008 10:20:31 +0100
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
.
- Follow-Ups:
- Re: Cant trap Exception.
- From: yannis
- Re: Cant trap Exception.
- Prev by Date: Re: Using TADOQuery for select using two tables
- Next by Date: Re: Cant trap Exception.
- Previous by thread: Re: Using TADOQuery for select using two tables
- Next by thread: Re: Cant trap Exception.
- Index(es):
Relevant Pages
|