Re: How to get ODBC the status of connection?
- From: Bob Hairgrove <NoSpamPlease@xxxxxxxx>
- Date: Tue, 07 Aug 2007 14:15:19 +0200
On Tue, 07 Aug 2007 00:09:17 -0700, Hooyoo <zhaohuyong@xxxxxxxxx>
wrote:
How can I get the status from the handle of connection? I have
initialized a connection at the beginning, but I need know whether the
connection is still established when I execute a sql statement. Is
there such kind of ODBC API?
For ODBC ver. 3.5, you can call SQLGetConnectAttr() with the argument
SQL_ATTR_CONNECTION_DEAD (see the "ODBC Programmer's Reference" for
details on how to call this function). I'm not aware of how this is
done in earlier ODBC versions; presumably you would just trap the
error which occurs when the SQL statement is prepared or executed.
If the handle itself is invalid, the call to SQLGetConnectAttr
returns SQL_INVALID_HANDLE.
--
Bob Hairgrove
NoSpamPlease@xxxxxxxx
.
- Follow-Ups:
- Re: How to get ODBC the status of connection?
- From: Hooyoo
- Re: How to get ODBC the status of connection?
- From: Hooyoo
- Re: How to get ODBC the status of connection?
- References:
- How to get ODBC the status of connection?
- From: Hooyoo
- How to get ODBC the status of connection?
- Prev by Date: How to get ODBC the status of connection?
- Next by Date: Re: How to get ODBC the status of connection?
- Previous by thread: How to get ODBC the status of connection?
- Next by thread: Re: How to get ODBC the status of connection?
- Index(es):
Relevant Pages
|