cancel
Showing results for 
Search instead for 
Did you mean: 

SybaseIQ C++ check if connected

Former Member
3,053

Could someone please tell me how can i check if there is an active connection to sybaseIQ? I would like to perform a check before sending statements so that I have a chance to re-establish the connection in case it was lost.

I am using sacapi.h, sacapidll.cpp, sacapidll.h (SQL Anywhere C API which is layered on top of the DBLIB package and it was implemented with Embedded SQL).

I don't think callbacks are supported. I can't find documentation on sqlany_register_callback in the SybaseIQ documentation

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor

Hm, according to the v16 online docs, I stand corrected w.r.t. my statement the C API would not support a callback (I had just checked for v12.0.1, see my comment on the question):

Support for callbacks in the SQL Anywhere C API - Support for callbacks has been added to version 3 of the SQL Anywhere C API. The following function is now available when _SACAPI_VERSION is defined as 3.

sacapi_bool sqlany_register_callback( a_sqlany_connection * sqlany_conn, a_sqlany_callback_type index, SQLANY_CALLBACK_PARM callback );

This function can be used to register callback functions.

Note: That's what the docs say, I have not tested that myself...


And here's the whole story including a sample from the according CR note 738036 as released with v16.0.0.1522 and above, and these versions do contain an according sample "callback.cpp", too.

Former Member
0 Kudos

unfortunately it's not supported in SybaseIQ 😞