Hi,
I'm using CSDK 4.50.UC.11 on Linux to access Informix 14.10 (64-bit) that is running on the same Linux VM.
Here's the code:
/*
* EXEC SQL CONNECT TO :Did AS :Cid USER :Uid USING :Pid WITH CONCURRENT TRANSACTION;
*/
{
ifx_conn_t *_sqiconn;
_sqiconn = (ifx_conn_t *)ifx_alloc_conn_user(Uid, Pid);
TRACE0(pThd,SL07, "Spagna: before connect_open");
sqli_connect_open(ESQLINTVERSION, 0, Did, Cid, _sqiconn, 1);
TRACE0(pThd,SL07, "Spagna: after connect_open");
ifx_free_conn_user(&_sqiconn);
TRACE0(pThd,SL07, "Spagna: after ifx_free_conn_user");
}
TRACE0(pThd,SL07, "Spagna: before checking SQLCODE");
// Check for error
if ( SQLCODE < 0 )
{
TRACE0(pThd,SL07, "Spagna: ERROR: SQLCODE < 0!");
rc = SQLCODE;
PST_GOTO_UNEXPECTED_RC(pThd,OpenConn,rc,"Connect_Error")
}
TRACE0(pThd,SL07, "Spagna: SQLCODE = 0!");
And here's what is in the log:
Spagna: going to attempt to connect
DSQLIFCN DSQLINFXOpenConnection (0819) SL07 08/16/2024 09:51:19 002037 00014C2D 00000056
Spagna: before connect_open
DSQLIFCN DSQLINFXOpenConnection (0821) SL07 08/16/2024 09:51:19 002038 00014C2D 00000056
Spagna: after connect_open
DSQLIFCN DSQLINFXOpenConnection (0823) SL07 08/16/2024 09:51:19 002039 00014C2D 00000056
Spagna: after ifx_free_conn_user
DSQLIFCN DSQLINFXOpenConnection (0827) SL07 08/16/2024 09:51:19 002040 00014C2D 00000056
Spagna: before checking SQLCODE
ERRLERRH ERR_RetryMgr (0293) EXCP 08/16/2024 09:51:19 002041 00014C2D 00000056
Win32 Exception=C0000005 at Address=00000000 Desc=Access Violation
ERRLERRH ERR_RetryMgr (0000) ENVE 08/16/2024 09:51:19 002042 00014C2D 00000056
Exception:C0000005 (Access Violation) at (nil)
I found the definition of SQLCODE:
./incl/esql/sqlca.h:#define SQLCODE (*(ifx_sqlcode()))
I'd like to add that the same code, running on Windows using CSDK 4.50.FC11, works fine:
Spagna: going to attempt to connect
DSQCIFCN DSQLINFXOpenConnection (0812) SL07 08/16/2024 10:34:49 000290 00000840 00000F90
Spagna: before connect_open
DSQCIFCN DSQLINFXOpenConnection (0814) SL07 08/16/2024 10:34:49 000291 00000840 00000F90
Spagna: after connect_open
DSQCIFCN DSQLINFXOpenConnection (0816) SL07 08/16/2024 10:34:49 000292 00000840 00000F90
Spagna: after ifx_free_conn_user
DSQCIFCN DSQLINFXOpenConnection (0821) SL07 08/16/2024 10:34:49 000293 00000840 00000F90
Spagna: before checking SQLCODE
DSQCIFCN DSQLINFXOpenConnection (0829) SL07 08/16/2024 10:34:49 000294 00000840 00000F90
Spagna: SQLCODE = 0!
Has anyone else ever encountered this and know what the solution is?
Thanks!
------------------------------
Rick Spagna
Optim Development Director
UNICOM Global
973-755-4092
------------------------------