From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/odbc32/proxyodbc.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index dbe080f424f..0be72844311 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -325,6 +325,16 @@ static CRITICAL_SECTION_DEBUG loader_cs_debug = }; static CRITICAL_SECTION loader_cs = { &loader_cs_debug, -1, 0, 0, 0, 0 };
+static struct object *find_object_type(SQLSMALLINT type, struct object *object) +{ + while (object && object->type != type) + { + object = object->parent; + } + + return object; +} + static struct { UINT32 count; @@ -2630,8 +2640,21 @@ static SQLRETURN get_data_win32( struct statement *stmt, SQLUSMALLINT column, SQ free( data ); return ret; } + else + { + struct connection *conn = (struct connection *)find_object_type(SQL_HANDLE_DBC, stmt->hdr.parent); + if (conn && conn->driver_odbc_ver < 0x300) + { + if (type == SQL_C_TYPE_TIME) + type = SQL_C_TIME; + else if (type == SQL_C_TYPE_DATE) + type = SQL_C_DATE; + else if (type == SQL_C_TYPE_TIMESTAMP) + type = SQL_C_TIMESTAMP; + }
- return stmt->hdr.win32_funcs->SQLGetData( stmt->hdr.win32_handle, column, type, value, buflen, retlen ); + return stmt->hdr.win32_funcs->SQLGetData( stmt->hdr.win32_handle, column, type, value, buflen, retlen ); + } }
/*************************************************************************