Lost of connection on newtwork error.

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
EderWillian
Posts: 12
Joined: Tue 21 Aug 2007 14:25

Lost of connection on newtwork error.

Post by EderWillian » Fri 04 Jan 2008 11:10

Hello friends,

I'm using dbexpsda 3.0 on a Delphi 7 client/server application.
There's only a sqlconnection that remains opened for all the program execution.

My problem is when occurs a network error, for example:
- a switch is restarted.
- a network cable is disconected and after connected.
- etc

These problems causes an error on my opened connection.
There's any component or a tip to help me to resolve this problem?

Best regards

Eder Willian

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 09 Jan 2008 16:04

You should reconnect after your connection become broken and then recovered:

Code: Select all

  SQLConnection.Active = False;
  SQLConnection.Active = True;

martin
Posts: 52
Joined: Mon 07 Nov 2005 09:48

Post by martin » Fri 03 Jul 2009 07:23

Antaeus wrote:You should reconnect after your connection become broken and then recovered:

Code: Select all

  SQLConnection.Active = False;
  SQLConnection.Active = True;
Is there a specific error code or exception class to catch and find out, that the connection is actually broken and that's not just a "regular" error like wrong sql code or other kind of exception etc.

EDatabaseError does not say much.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 03 Jul 2009 13:51

DbxSda doesn't have such specific error, bacause the connection can be disconnected because of different reasons. Last versions of DbxSda should handle such problems.

Post Reply