From 2834d453dab7a66f3d16bada6c295a828d14d4f0 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 12 Jul 2024 14:55:47 +1000 Subject: [PATCH] odbc32: SQLSetConnectAttr/W handle fallback function --- dlls/odbc32/proxyodbc.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 11fcbe97be8..1c92560d7ee 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -2194,7 +2194,13 @@ SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, Attribute, Value, StringLength ); + if(handle->win32_funcs->SQLSetConnectOption) + ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, Attribute, Value, StringLength ); + else if(handle->win32_funcs->SQLSetConnectOption) + { + /* ODBC v2 */ + ret = handle->win32_funcs->SQLSetConnectOption( handle->win32_handle, Attribute, (SQLULEN)Value ); + } } else { @@ -4133,7 +4139,13 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, Attribute, Value, StringLength ); + if (handle->win32_funcs->SQLSetConnectAttrW) + ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, Attribute, Value, StringLength ); + else if(handle->win32_funcs->SQLSetConnectOptionW) + { + /* ODBC v2 */ + ret = handle->win32_funcs->SQLSetConnectOptionW( handle->win32_handle, Attribute, (SQLULEN)Value ); + } } else { -- 2.43.0