[unixODBC-dev] SQLDriverConnect()

Igor Korot ikorot at earthlink.net
Wed Aug 27 04:58:23 BST 2008


Hi, (Nick),
This is the code from unixODBC 2.2.12 SQLDriverConnect:


    /*
     * look for some keywords
     *
     * TO_DO FILEDSN's
     *
     * have we got a DRIVER= attribute
     */

    driver = __get_attribute_value( &con_struct, "DRIVER" );
    if ( driver )
    {
        /*
         * look up the driver in the ini file
         */

        strcpy( driver_name, driver );

        SQLGetPrivateProfileString( driver, "Driver", "",
                lib_name, sizeof( lib_name ), "ODBCINST.INI" );

        if ( lib_name[ 0 ] == '\0' )
        {
            /*
             * at this point a box could pop up to allow the selection of a driver
             *
             * do this later
             */

            dm_log_write( __FILE__, 
                    __LINE__, 
                    LOG_INFO, 
                    LOG_INFO, 
                    "Error: IM002" );

            __post_internal_error( &connection -> error,
                    ERROR_IM002, NULL,
                    connection -> environment -> requested_version );
            __release_conn( &con_struct );

            return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR );
        }

Will a dialog shows up in 2.2.13?

Thank you.




More information about the unixODBC-dev mailing list