SQLRDD connection dropped

96 views
Skip to first unread message

Claudio H

unread,
May 26, 2022, 12:18:22 PMMay 26
to
Hi

What's the best way to check if an active connection is still alive?
I might guess the connection is probably dropped by leaving the app in an idle state for too long beyond the server timeout.

I'm getting the following message:
SR_ODBC/0 SQLExecDirect Error
08S01 - 10054 - [Microsoft][SQL Server Native Client 11.0]TCP Provider: Se ha forzado la interrupción de una conexión existente por el host remoto (an existing connection was interrupted by the remote host)

Regards
Claudio H

dlzc

unread,
May 26, 2022, 12:29:21 PMMay 26
to
Dear Claudio H:

On Thursday, May 26, 2022 at 9:18:22 AM UTC-7, Claudio H wrote:
> What's the best way to check if an active connection is still alive?

> I might guess the connection is probably dropped by leaving the app
> in an idle state for too long beyond the server timeout.

I don"t use SQLRDD.
https://groups.google.com/g/comp.lang.xharbour/c/WP4_mdhz9hc/m/MYpH0PKubqYJ

Looks like:
SR_GetConnection( nConnection )
Obtain the connection object to <nConnection>
... might throw a detectable error.

SR_GetActiveConnection()
Get the active connection number
... might not return a valid (or recorded) connection number.

SR_SetActiveConnection( nCnn )
Set the active connection number
... might be used at the heart of a "keep alive" function? Prevent timeouts, maybe.

Alternatively, you could close any connections when entering a menu, and auto-close editing sessions to return to a menu state after so may minutes idle.

May have been more functionality added in 14 years...

David A. Smith

Claudio H

unread,
Jun 1, 2022, 5:24:31 PMJun 1
to
Hi
I found the SR_CheckCnn() function that checks exactly what I need.
Regards
Claudio H
Reply all
Reply to author
Forward
0 new messages