Re: ADO reconnect after disconnect

From: Val Mazur (group51a_at_hotmail.com)
Date: 11/24/04


Date: Tue, 23 Nov 2004 20:14:57 -0500

Hi,

Yes, it works this way. OLEDB does not monitor if connection was dropped for
some reason and in this case ADO will still show you that connection is
opened, even if was dropped some time ago. You cannot
reconnect recordset in this case. Only way to reconnect recordset is to
disconnect it first after you opened it. Then work with the data in a
disconnected recordset and reconnect it back to the database when you need
it. But if connection was dropped in a middle, you would need to reopen it
again anyway, but data in a recordset will stay.

-- 
Val Mazur
Microsoft MVP
"john smith" <jblack004@hotmail.com> wrote in message 
news:cnvhs5$ila$1@ctb-nnrp2.saix.net...
> Hi,
> If I set an ADOConnection to keep the connection open during queries, I 
> have a problem reconnecting should I be disconnected due to network 
> failure. Everytime I try to reconnect after being disconnected the 
> ADOconnection reports it has connected even with the network cable 
> unplugged. I also cant close the connection after being disconnected.
>
> At the moment the only way around seems to be to destroy the ADO 
> components and recreate the tables and datasets and then simply start the 
> connection from the beginning. I am able to detect when I am disconnected.
>
> Thanks for any help,
> S.
> 


Relevant Pages

  • Re: Virus-infected hosts list
    ... >> number of my IP by one if I disconnect and reconnect. ... >> thinks if he disconnects and reconnects he'll get a better connection. ... > making headway against the virus deluge this way. ...
    (Debian-User)
  • Re: Fixing or REPLACING I.E.6
    ... Also, it may be that your connection setups need to be adjusted, as in, ... been idle while on the Internet. ... This is referred to as the Idle Disconnect ... Download the newest version of HiJackThis here: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Reconnecting at dropped connection
    ... Reconnect to disconnected sessions only works reliable when the ... connection a little more stable ... I've had to enable auto disconnect after 30 ...
    (microsoft.public.windows.terminal_services)
  • Re: ZAP, disconnecting and reconnecting
    ... It seems that I can disconnect and reconnect to my ISP (56K Modem ... connection) with no problem, as long as I do it myself. ...
    (comp.security.firewalls)
  • Re: re-connect fails with "[DBNetlib][Connectionread (Recv()).] General network error. Check yo
    ... problem by dramatically reducing the need to disconnect and reconnect. ... > code to set connection string. ...
    (borland.public.delphi.database.ado)