From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/odbc32/proxyodbc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 4799ca0a11e..6d4772f7f11 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -493,12 +493,17 @@ static SQLRETURN alloc_stmt_unix( struct handle *con, struct handle *stmt )
static SQLRETURN alloc_stmt_win32( struct handle *con, struct handle *stmt ) { - if (con->win32_funcs->SQLAllocStmt) + SQLRETURN ret = SQL_ERROR; + if (con->win32_funcs->SQLAllocHandle) { - SQLRETURN ret = con->win32_funcs->SQLAllocStmt( con->win32_handle, &stmt->win32_handle ); - if (SUCCESS( ret )) stmt->win32_funcs = con->win32_funcs; + ret = con->win32_funcs->SQLAllocHandle( SQL_HANDLE_STMT, con->win32_handle, &stmt->win32_handle ); } - return SQL_ERROR; + else if (con->win32_funcs->SQLAllocStmt) + { + ret = con->win32_funcs->SQLAllocStmt( con->win32_handle, &stmt->win32_handle ); + } + if (SUCCESS( ret )) stmt->win32_funcs = con->win32_funcs; + return ret; }
/*************************************************************************