SQL Server KeepAlive

Igor Korot 6 Reputation points
2024-08-01T22:19:34.0533333+00:00

Hi, ALL,

I'm trying to write a program connecting to MS SQL Server.

The program will be using ODBC to connect and SQLDriverConnect() API to do a connection.

What I wonder is whether it is possible from the C/C++ ODBC interface set the "KeepAlive" connection option or it is possible only for the ODBC driver settings in the ODBC Driver Manager.

Thank you.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,693 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 11,506 Reputation points Microsoft Vendor
    2024-08-02T03:22:18.0166667+00:00

    Hi,

    From doc: Connecting from Linux or macOS

    Beginning with ODBC Driver 17.8, KeepAlive and KeepAliveInterval keywords can be specified in the connection string.

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.