From eb9fa655f1a1a6f209763e13ba7ee192cdc59be3 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 12 Jul 2024 14:40:32 +1000 Subject: [PATCH] odbc32: SQLBindParameter handle fallback function --- dlls/odbc32/proxyodbc.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index d218efb9545..11fcbe97be8 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -3367,9 +3367,34 @@ SQLRETURN WINAPI SQLBindParameter(SQLHSTMT StatementHandle, SQLUSMALLINT Paramet } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLBindParameter( handle->win32_handle, ParameterNumber, InputOutputType, ValueType, + if (handle->win32_funcs->SQLBindParameter) + { + ret = handle->win32_funcs->SQLBindParameter( handle->win32_handle, ParameterNumber, InputOutputType, ValueType, ParameterType, ColumnSize, DecimalDigits, ParameterValue, BufferLength, StrLen_or_Ind ); + } + else if(handle->win32_funcs->SQLBindParam) + { + /* ODBC v2 */ + /* TODO: Make function */ + if(ValueType == SQL_C_TYPE_TIME) + ValueType = SQL_C_TIME; + else if(ValueType == SQL_C_TYPE_DATE) + ValueType = SQL_C_DATE; + else if(ValueType == SQL_C_TYPE_TIMESTAMP) + ValueType = SQL_C_TIMESTAMP; + + /* TODO: Make function */ + if (ParameterType == SQL_TIME) + ParameterType = SQL_TYPE_TIME; + else if (ParameterType == SQL_DATE) + ParameterType = SQL_TYPE_DATE; + else if (ParameterType == SQL_TIMESTAMP) + ParameterType = SQL_TYPE_TIMESTAMP;;; + + ret = handle->win32_funcs->SQLBindParam(handle->win32_handle, ParameterNumber, ValueType, ParameterType, + ColumnSize, DecimalDigits, ParameterValue, StrLen_or_Ind); + } } TRACE("Returning %d\n", ret); -- 2.43.0