From fbc17da7bbb48155d2fe1225f159a2b50b7aaf65 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 1 May 2025 08:10:04 +1000 Subject: [PATCH] odbc32: SQLPrepareW add ascii fallback --- dlls/odbc32/proxyodbc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 799ea5accf2..0fed17640c1 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -6199,10 +6199,17 @@ static SQLRETURN prepare_unix_w( struct statement *stmt, SQLWCHAR *statement, SQ static SQLRETURN prepare_win32_w( struct statement *stmt, SQLWCHAR *statement, SQLINTEGER len ) { + SQLRETURN ret = SQL_ERROR; + if (stmt->hdr.win32_funcs->SQLPrepareW) return stmt->hdr.win32_funcs->SQLPrepareW( stmt->hdr.win32_handle, statement, len ); - if (stmt->hdr.win32_funcs->SQLPrepare) FIXME( "Unicode to ANSI conversion not handled\n" ); - return SQL_ERROR; + if (stmt->hdr.win32_funcs->SQLPrepare) + { + SQLCHAR *statementA = (SQLCHAR*)strdupWtoA( statement ); + ret = stmt->hdr.win32_funcs->SQLPrepare( stmt->hdr.win32_handle, statementA, len ); + free(statementA); + } + return ret; } /************************************************************************* -- 2.47.2