Share this page

# Example: lrd_db_option

In the following example, the lrd_db_option function sets two ODBC options. The first option activates the ODBC's SQL_TXN_READ_COMMITTED option and the second option deactivates the SQL_AUTOCOMMIT option.

    lrd_init(&InitInfo, DBTypeVersion);

    lrd_open_context(&Ctx1, LRD_DBTYPE_ODBC, 0, 0, 0);

    lrd_alloc_connection(&Con1, LRD_DBTYPE_ODBC, Ctx1, 0 /*Unused*/, 0);

    lrd_db_option

        (Con1, OT_ODBC_TXN_READ_COMMITTED,

        LRD_OPTION_VAL_LETTER_YES,

        LRD_DB_ERROR_SEVERITY_ERROR);

    lrd_db_option

        (Con1, OT_ODBC_AUTOCOMMIT,

        LRD_OPTION_VAL_LETTER_NO,

        LRD_DB_ERROR_SEVERITY_ERROR);

    lrd_open_connection(&Con1, LRD_TYPE_ODBC, "", "", "flight32_quadbase", "", Ctx1, 0, 0);

    lrd_open_cursor(&Csr1, Con1, 0);

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: