On Thu Jul 11 07:18:07 2024 +0000, Alistair Leslie-Hughes wrote:
You cannot assume for a native window driver that this function will exist. For example, the MySQL ODBC driver has two DLL's (ASCII and Unicode), so in this case only the ascii version will work. Suggestion.
- ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, attr, value, len ); + if (handle->win32_funcs->SQLSetConnectAttr) + ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, attr, value, len ); + else if (handle->win32_funcs->SQLSetConnectAttrW) + ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, attr, value, len );
That will not work without conversion of string attributes. If the app uses a data source configured for the Unicode driver but calls ANSI functions then we should probably convert. I don't expect this to be common though. If it's the other around then the conversion would be lossy. This would need some tests.