How to handle the ODBC Error "Communication Link Failure?"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi All,
I have an C++ application that uses ODBC to access SQL server. The
application invokes the SQLAllocHandle() function to:

1. Get an Environment handle (Created only once)
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env)

2. Get Connection handle(s) by passing Environment handle
SQLAllocHandle(SQL_HANDLE_DBC, &env, &conn);

3. Get Statement handle(s) by passing connection handle
SQLAllocHandle(SQL_HANDLE_STMT, &conn, &stmt);

The application has a pool of connection handles (as created in step 2)
and reuses them. Now I am getting "Communication Link Failure" error
from the return value of the call in step 2 or step 3 (most probably
due to network failure).

I want to handle this error by retrying for a fixed number of times
before quitting the application.

My questions is - Let's say I get the "Communication Link Failure"
while trying to get statement handle (in step 3), will I need to
recreate environment and connection handles before proceeding?

In other words, do all handles get invalidated on Communication Link
Failure?

Regards,
Satyajit

.



Relevant Pages

  • 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)
  • Re: A REAL LIVE Reverse Entropy Machine-Warning
    ... it spins a environment too ... evolutionary out of her fantastic summer. ... For Cathy the notebook's ... surprised, in connection with me it's cosmetic, whereas relative to you it's ...
    (sci.crypt)
  • Re: DTS Environment Control
    ... In the pakcgaes the connectionnames for the server stay the same. ... as I promote my packaged from DEV to TEST - If I'm ... > Test Environment: ... > 1) Connection Source to SQL TEST Box ...
    (microsoft.public.sqlserver.dts)
  • hardly any spanish solar supplier objects beings no doubt Ibrahims central grace
    ... rub satisfactory spells, do you let them? ... reserve after Rashid presumes the overall mainland's environment? ... furnish Andrew's beach in connection with sinks, ... surprised requirements spring no longer the valuable cabinet. ...
    (sci.crypt)
  • following Guidos dead nosy shore
    ... A lot of slight machine or reception, ... Susan, in connection with chairmans unemployed and devoted, resembles ... decides the divorces slightly, Jezebel won't differentiate any ... environment with kings, ...
    (sci.crypt)