Re: Connection terminated by server problem




when I read the connected property of the ADOConnection it still shows
connected=true and then only when I executes the query I get the
"Communication link failure: Connection was terminated" error. But I need
to
know even before I execute or better trap it when it happens.

How can I trap that kind of disconnects with ADOConnection?

This seems to be a problem with ADO. You can't know if your connection is
alive until you try to access the database as you did. The solution we
recently implemented in a app was to use a TTimer and fire a inofensive SQL
to the DB. If there is a connection failure, you need to set the Connected
property to False manually and them try to reconnected.

Regards

--
Jackson Gomes
Tools&Comps - Security Components for Borland Developers.
Web Site: http://www.toolsandcomps.com
Our Forum: http://groups.yahoo.com/group/toolsandcomps
e-mail: jackson@xxxxxxxxxxxxxxxxx
Phone: 55 31 38494946


.



Relevant Pages

  • Re: Connection terminated by server problem
    ... execute a query check if it is still connected. ... Connection was terminated" error. ... How can I trap that kind of disconnects with ADOConnection? ...
    (borland.public.delphi.database.ado)
  • RE: How to handle the ODBC Error "Communication Link Failure?"
    ... Your calls to get a connection handle and statement handle are incorrect. ... Get Connection handleby passing Environment handle ... Now I am getting "Communication Link Failure" error ...
    (microsoft.public.sqlserver.odbc)
  • How to handle the ODBC Error "Communication Link Failure?"
    ... Get Connection handleby passing Environment handle ... My questions is - Let's say I get the "Communication Link Failure" ...
    (microsoft.public.sqlserver.odbc)
  • Problem with database drop connection
    ... execute a query. ... Well if the database drops the connection for whatever ... Connection was terminated" once I execute the query but I need to ... Anybody know how to trap for disconnects initiated by the server side? ...
    (borland.public.delphi.database.ado)
  • Re: ASP - FROM statement slows down connection to database
    ... Open your database in Access, switch to the Queries tab, create a new query ... in Design View without choosing a table, swtich to SQL View, paste the sql ... connection string rather than using an ... recordset open statements. ...
    (microsoft.public.inetserver.asp.db)