Module: wine Branch: master Commit: 551a3e6887c4f79daa823ddc366996243a977fa9 URL: https://gitlab.winehq.org/wine/wine/-/commit/551a3e6887c4f79daa823ddc3669962...
Author: Hans Leidekker hans@codeweavers.com Date: Fri Jul 12 08:24:58 2024 +0200
odbc32: Use SQLSetConnectAttrW() instead of SQLSetConnectAttr() if possible.
---
dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 033d009be50..957584af008 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -854,7 +854,20 @@ static SQLRETURN set_con_attr( struct handle *handle, SQLINTEGER attr, SQLPOINTE } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, attr, value, len ); + switch (attr) + { + case SQL_ATTR_CURRENT_CATALOG: + case SQL_ATTR_TRACEFILE: + case SQL_ATTR_TRANSLATE_LIB: + ERR( "string attribute %u not handled\n", attr ); + return SQL_ERROR; + default: + break; + } + if (handle->win32_funcs->SQLSetConnectAttrW) + ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, attr, value, len ); + else if (handle->win32_funcs->SQLSetConnectAttr) + ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, attr, value, len ); } return ret; }