ADO Connection Failure

From: Keith Comley (klcomley_at_ntlworld.com)
Date: 01/20/04

  • Next message: Marlin: "Re: LoginPrompt - dialog box"
    Date: Tue, 20 Jan 2004 21:32:27 -0000
    
    

    Hello,

    The following post is by Todd Neuman on the elists support site, he is
    asking the same question as I am and as he puts it so eloquently I felt it
    inappropriate to re-invent the wheel. Unfortunately he didn't get a
    satisfactory response, his post dates form 2001

    Thanks,

    Keith Comley:

    "Hi Everyone,

    I'm curious what other people have done about broken connections using
    TADOConnection in D5 Enterprise. We are having an issue in our application
    where we use ADO 2.6 over TCP/IP to communicate with MS SQL 2000 data
    servers. The issue is if anything hiccups in your physical connection to
    the database ADOExpress does not reflect this change but rather generates a
    Connection Failure error message. Even after this error message the
    ADOConnection Status is still "Connected" erroneously.

    I have been able to trap the error at the ADOCommand.Execute level and check
    the ADOConnection.Errors.Count and grab the message. I have even been able
    to then close the ADOConnectiona and reopen it successfully. The problem is
    that any queries that were previously open are no longer open once you
    re-establish the connection.

    First Question - Does anyone know how to move this check to the
    ADOConnection Level? I have one ADOConnection object and 70 - 80
    Queries/Commands, I'd like to solve it at the single ADOConnection level if
    possible. I tried the OnWillExecute, OnInformation, and OnError events in
    ADOConnection but they all pass successfully because they all execute prior
    to the actual execution of the ADOCommand.Execute attempting to complete and
    then failing.

    Second Question - Does anyone know of a way to reestablish the ADOConnection
    without Closing all of the active Queries using that connection?

    Thanks for all your help,
    Todd"


  • Next message: Marlin: "Re: LoginPrompt - dialog box"

    Relevant Pages

    • Re: module
      ... Dim adoConnection As ADODB.connection ... I don't understand why connection is not written Connection - that should be automatic. ... Copy that into google, including quotes. ...
      (microsoft.public.vb.general.discussion)
    • Re: ADOConnection fail after a while in TThread
      ... I, as Martin, do not think it is wise to use so much of objects (both ADO and thread), Nevertheless you might increase the socket count etc. ... If you do not use Transactions and have only one Query per Connection you even do not need the Connection. ... The simpliest the best:) Solve the problem with "not permanent" connection to your stores. ... One strange thing is that I have a ADOConnection in the main thread as well. ...
      (borland.public.delphi.database.ado)
    • Connection terminated by server problem
      ... database terminates abnormal or is stopped or for what ever reason, ... read the connected property of the ADOConnection it still shows ... "Communication link failure: Connection was terminated" error. ... know even before I execute or better trap it when it happens. ...
      (borland.public.delphi.database.ado)
    • ADOConnection - odd problem solved but why?
      ... I have a form with an ADOconnection and two tables. ... Set to True at design time, ... Maybe an application cannot handle more than one ADO connection at once ...
      (alt.comp.lang.borland-delphi)
    • ADOConnection.Connected does not show lost connection.
      ... I am using ADOConnection object in order to connect to an MS SQL Server 2000 ... I am using the ADOConnection.Connected property to see if the connection is ... still active, but once connected, event if I loose internet connection, it ...
      (borland.public.delphi.database.ado)