RE: How to handle the ODBC Error "Communication Link Failure?"
- From: wread@xxxxxxxxxxxxxxxxxxxx (Warren Read)
- Date: Mon, 31 Oct 2005 22:59:22 GMT
Your calls to get a connection handle and statement handle are incorrect.
SQLAllocHandle(SQL_HANDLE_DBC, &env, &conn);
should be
SQLAllocHandle(SQL_HANDLE_DBC, env, &conn);
(Don't pass address of env handle)
SQLAllocHandle(SQL_HANDLE_STMT, &conn, &stmt);
should be
SQLAllocHandle(SQL_HANDLE_STMT, conn, &stmt);
(Don't pass address of conn handle)
--------------------
| From: "Satyajit" <satyajit_rai@xxxxxxxxxxxxxx>
| Newsgroups: microsoft.public.sqlserver.odbc
| Subject: How to handle the ODBC Error "Communication Link Failure?"
| Date: 20 Oct 2005 08:32:11 -0700
| Organization: http://groups.google.com
| Lines: 31
| Message-ID: <1129822331.153917.17630@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
| NNTP-Posting-Host: 203.199.164.2
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1129822336 22923 127.0.0.1 (20 Oct 2005
15:32:16 GMT)
| X-Complaints-To: groups-abuse@xxxxxxxxxx
| NNTP-Posting-Date: Thu, 20 Oct 2005 15:32:16 +0000 (UTC)
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US;
rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe)
| X-HTTP-Via: 1.1 PTPROXY, 1.1 maproxy.persistent.co.in:80
(squid/2.5.STABLE5)
| Complaints-To: groups-abuse@xxxxxxxxxx
| Injection-Info: z14g2000cwz.googlegroups.com; posting-host=203.199.164.2;
| posting-account=llYfBA0AAADo7FoQV3qYFsmNLrpE0LdM
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.odbc:2880
| X-Tomcat-NG: microsoft.public.sqlserver.odbc
|
| 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
|
|
.
- Prev by Date: RE: varchar truncated to 1023 characters
- Next by Date: RE: Modify the name of the table
- Previous by thread: RE: varchar truncated to 1023 characters
- Next by thread: RE: Modify the name of the table
- Index(es):
Relevant Pages
|