1999-12-12 00:56:46 +01:00
|
|
|
/*
|
|
|
|
* Win32 ODBC functions
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright 1999 Xiang Li, Corel Corporation
|
1999-12-12 00:56:46 +01:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-10-02 06:25:21 +02:00
|
|
|
*
|
|
|
|
* NOTES:
|
|
|
|
* Proxy ODBC driver manager. This manager delegates all ODBC
|
|
|
|
* calls to a real ODBC driver manager named by the environment
|
|
|
|
* variable LIB_ODBC_DRIVER_MANAGER, or to libodbc.so if the
|
|
|
|
* variable is not set.
|
|
|
|
*
|
1999-12-12 00:56:46 +01:00
|
|
|
*/
|
|
|
|
|
2001-11-06 21:57:11 +01:00
|
|
|
#include "config.h"
|
2001-10-14 18:25:47 +02:00
|
|
|
#include "wine/port.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
1999-12-12 00:56:46 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2001-10-02 22:28:06 +02:00
|
|
|
#include <assert.h>
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
1999-12-12 00:56:46 +01:00
|
|
|
#include "winbase.h"
|
2004-10-19 00:47:14 +02:00
|
|
|
#include "winreg.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2002-04-26 21:05:15 +02:00
|
|
|
#include "wine/library.h"
|
2005-01-25 20:04:03 +01:00
|
|
|
#include "wine/unicode.h"
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
#include "sql.h"
|
|
|
|
#include "sqltypes.h"
|
|
|
|
#include "sqlext.h"
|
|
|
|
|
2001-10-02 22:28:06 +02:00
|
|
|
static BOOL ODBC_LoadDriverManager(void);
|
|
|
|
static BOOL ODBC_LoadDMFunctions(void);
|
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(odbc);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
static SQLRETURN (*pSQLAllocConnect)(SQLHENV,SQLHDBC*);
|
|
|
|
static SQLRETURN (*pSQLAllocEnv)(SQLHENV*);
|
|
|
|
static SQLRETURN (*pSQLAllocHandle)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*);
|
|
|
|
static SQLRETURN (*pSQLAllocHandleStd)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*);
|
|
|
|
static SQLRETURN (*pSQLAllocStmt)(SQLHDBC,SQLHSTMT*);
|
|
|
|
static SQLRETURN (*pSQLBindCol)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLBindParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLUINTEGER,SQLSMALLINT,SQLPOINTER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLBindParameter)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLUINTEGER,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLBrowseConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLBrowseConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLBulkOperations)(SQLHSTMT,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLCancel)(SQLHSTMT);
|
|
|
|
static SQLRETURN (*pSQLCloseCursor)(SQLHSTMT);
|
|
|
|
static SQLRETURN (*pSQLColAttribute)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER);
|
|
|
|
static SQLRETURN (*pSQLColAttributeW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER);
|
|
|
|
static SQLRETURN (*pSQLColAttributes)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLColAttributesW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER);
|
|
|
|
static SQLRETURN (*pSQLColumnPrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLColumnPrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLCopyDesc)(SQLHDESC,SQLHDESC);
|
|
|
|
static SQLRETURN (*pSQLDataSources)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLDataSourcesW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLDescribeCol)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLUINTEGER*,SQLSMALLINT*,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLDescribeColW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLDescribeParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLUINTEGER*,SQLSMALLINT*,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLDisconnect)(SQLHDBC);
|
|
|
|
static SQLRETURN (*pSQLDriverConnect)(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLDriverConnectW)(SQLHDBC,SQLHWND,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLDrivers)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLDriversW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLEndTran)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLError)(SQLHENV,SQLHDBC,SQLHSTMT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLErrorW)(SQLHENV,SQLHDBC,SQLHSTMT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLExecDirect)(SQLHSTMT,SQLCHAR*,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLExecDirectW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLExecute)(SQLHSTMT);
|
|
|
|
static SQLRETURN (*pSQLExtendedFetch)(SQLHSTMT,SQLUSMALLINT,SQLINTEGER,SQLUINTEGER*,SQLUSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLFetch)(SQLHSTMT);
|
|
|
|
static SQLRETURN (*pSQLFetchScroll)(SQLHSTMT,SQLSMALLINT,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLForeignKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLForeignKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLFreeConnect)(SQLHDBC);
|
|
|
|
static SQLRETURN (*pSQLFreeEnv)(SQLHENV);
|
|
|
|
static SQLRETURN (*pSQLFreeHandle)(SQLSMALLINT,SQLHANDLE);
|
|
|
|
static SQLRETURN (*pSQLFreeStmt)(SQLHSTMT,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLGetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLPOINTER);
|
|
|
|
static SQLRETURN (*pSQLGetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER);
|
|
|
|
static SQLRETURN (*pSQLGetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetData)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetDescRec)(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLINTEGER*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetDescRecW)(SQLHDESC,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetDiagField)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetDiagFieldW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetDiagRec)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetDiagRecW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetFunctions)(SQLHDBC,SQLUSMALLINT,SQLUSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetInfo)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetInfoW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLGetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLGetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLPOINTER);
|
|
|
|
static SQLRETURN (*pSQLGetTypeInfo)(SQLHSTMT,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLGetTypeInfoW)(SQLHSTMT,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLMoreResults)(SQLHSTMT);
|
|
|
|
static SQLRETURN (*pSQLNativeSql)(SQLHDBC,SQLCHAR*,SQLINTEGER,SQLCHAR*,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLNativeSqlW)(SQLHDBC,SQLWCHAR*,SQLINTEGER,SQLWCHAR*,SQLINTEGER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLNumParams)(SQLHSTMT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLNumResultCols)(SQLHSTMT,SQLSMALLINT*);
|
|
|
|
static SQLRETURN (*pSQLParamData)(SQLHSTMT,SQLPOINTER*);
|
|
|
|
static SQLRETURN (*pSQLParamOptions)(SQLHSTMT,SQLUINTEGER,SQLUINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLPrepare)(SQLHSTMT,SQLCHAR*,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLPrepareW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLPrimaryKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLPrimaryKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLProcedureColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLProcedureColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLProcedures)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLProceduresW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLPutData)(SQLHSTMT,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLRowCount)(SQLHSTMT,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLSetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLUINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLULEN);
|
|
|
|
static SQLRETURN (*pSQLSetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLSetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLSetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetDescRec)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLINTEGER,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER*,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLSetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLUINTEGER,SQLSMALLINT,SQLPOINTER,SQLINTEGER*);
|
|
|
|
static SQLRETURN (*pSQLSetPos)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLSetScrollOptions)(SQLHSTMT,SQLUSMALLINT,SQLINTEGER,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLSetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLUINTEGER);
|
|
|
|
static SQLRETURN (*pSQLSpecialColumns)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLSpecialColumnsW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLStatistics)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLStatisticsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLTablePrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLTablePrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLTables)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLTablesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
|
|
|
|
static SQLRETURN (*pSQLTransact)(SQLHENV,SQLHDBC,SQLUSMALLINT);
|
|
|
|
|
|
|
|
#define ERROR_FREE 0
|
|
|
|
#define ERROR_SQLERROR 1
|
|
|
|
#define ERROR_LIBRARY_NOT_FOUND 2
|
|
|
|
|
|
|
|
static void *dmHandle;
|
|
|
|
static int nErrorType;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2004-10-19 00:47:14 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* ODBC_ReplicateODBCInstToRegistry
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* Utility to ODBC_ReplicateToRegistry to replicate the drivers of the
|
|
|
|
* ODBCINST.INI settings
|
|
|
|
*
|
|
|
|
* The driver settings are not replicated to the registry. If we were to
|
|
|
|
* replicate them we would need to decide whether to replicate all settings
|
|
|
|
* or to do some translation; whether to remove any entries present only in
|
|
|
|
* the windows registry, etc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv)
|
|
|
|
{
|
|
|
|
HKEY hODBCInst;
|
|
|
|
LONG reg_ret;
|
|
|
|
int success;
|
|
|
|
|
|
|
|
success = 0;
|
|
|
|
TRACE ("Driver settings are not currently replicated to the registry\n");
|
|
|
|
if ((reg_ret = RegCreateKeyExA (HKEY_LOCAL_MACHINE,
|
|
|
|
"Software\\ODBC\\ODBCINST.INI", 0, NULL,
|
|
|
|
REG_OPTION_NON_VOLATILE,
|
|
|
|
KEY_ALL_ACCESS /* a couple more than we need */, NULL,
|
|
|
|
&hODBCInst, NULL)) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
HKEY hDrivers;
|
|
|
|
if ((reg_ret = RegCreateKeyExA (hODBCInst, "ODBC Drivers", 0,
|
|
|
|
NULL, REG_OPTION_NON_VOLATILE,
|
|
|
|
KEY_ALL_ACCESS /* overkill */, NULL, &hDrivers, NULL))
|
|
|
|
== ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
SQLRETURN sql_ret;
|
|
|
|
SQLUSMALLINT dirn;
|
2005-08-29 11:38:19 +02:00
|
|
|
CHAR desc [256];
|
2004-10-19 00:47:14 +02:00
|
|
|
SQLSMALLINT sizedesc;
|
|
|
|
|
|
|
|
success = 1;
|
|
|
|
dirn = SQL_FETCH_FIRST;
|
2005-08-29 11:38:19 +02:00
|
|
|
while ((sql_ret = SQLDrivers (hEnv, dirn, (SQLCHAR*)desc, sizeof(desc),
|
2004-10-19 00:47:14 +02:00
|
|
|
&sizedesc, NULL, 0, NULL)) == SQL_SUCCESS ||
|
|
|
|
sql_ret == SQL_SUCCESS_WITH_INFO)
|
|
|
|
{
|
|
|
|
/* FIXME Do some proper handling of the SUCCESS_WITH_INFO */
|
|
|
|
dirn = SQL_FETCH_NEXT;
|
2008-10-25 17:43:47 +02:00
|
|
|
if (sizedesc == lstrlenA(desc))
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
|
|
|
HKEY hThis;
|
|
|
|
if ((reg_ret = RegQueryValueExA (hDrivers, desc, NULL,
|
|
|
|
NULL, NULL, NULL)) == ERROR_FILE_NOT_FOUND)
|
|
|
|
{
|
|
|
|
if ((reg_ret = RegSetValueExA (hDrivers, desc, 0,
|
2006-09-20 22:11:18 +02:00
|
|
|
REG_SZ, (const BYTE *)"Installed", 10)) != ERROR_SUCCESS)
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d replicating driver %s\n",
|
2004-10-19 00:47:14 +02:00
|
|
|
reg_ret, desc);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (reg_ret != ERROR_SUCCESS)
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d checking for %s in drivers\n",
|
2004-10-19 00:47:14 +02:00
|
|
|
reg_ret, desc);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
if ((reg_ret = RegCreateKeyExA (hODBCInst, desc, 0,
|
|
|
|
NULL, REG_OPTION_NON_VOLATILE,
|
|
|
|
KEY_ALL_ACCESS, NULL, &hThis, NULL))
|
|
|
|
== ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
/* FIXME This is where the settings go.
|
|
|
|
* I suggest that if the disposition says it
|
|
|
|
* exists then we leave it alone. Alternatively
|
|
|
|
* include an extra value to flag that it is
|
|
|
|
* a replication of the unixODBC/iODBC/...
|
|
|
|
*/
|
|
|
|
if ((reg_ret = RegCloseKey (hThis)) !=
|
|
|
|
ERROR_SUCCESS)
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d closing %s key\n", reg_ret,
|
2004-10-19 00:47:14 +02:00
|
|
|
desc);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d ensuring driver key %s\n",
|
2004-10-19 00:47:14 +02:00
|
|
|
reg_ret, desc);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WARN ("Unusually long driver name %s not replicated\n",
|
|
|
|
desc);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sql_ret != SQL_NO_DATA)
|
|
|
|
{
|
|
|
|
TRACE ("Error %d enumerating drivers\n", (int)sql_ret);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
if ((reg_ret = RegCloseKey (hDrivers)) != ERROR_SUCCESS)
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d closing hDrivers\n", reg_ret);
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d opening HKLM\\S\\O\\OI\\Drivers\n", reg_ret);
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
if ((reg_ret = RegCloseKey (hODBCInst)) != ERROR_SUCCESS)
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d closing HKLM\\S\\O\\ODBCINST.INI\n", reg_ret);
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d opening HKLM\\S\\O\\ODBCINST.INI\n", reg_ret);
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
if (!success)
|
|
|
|
{
|
|
|
|
WARN ("May not have replicated all ODBC drivers to the registry\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ODBC_ReplicateODBCToRegistry
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* Utility to ODBC_ReplicateToRegistry to replicate either the USER or
|
|
|
|
* SYSTEM dsns
|
|
|
|
*
|
|
|
|
* For now simply place the "Driver description" (as returned by SQLDataSources)
|
|
|
|
* into the registry as the driver. This is enough to satisfy Crystal's
|
|
|
|
* requirement that there be a driver entry. (It doesn't seem to care what
|
|
|
|
* the setting is).
|
|
|
|
* A slightly more accurate setting would be to access the registry to find
|
|
|
|
* the actual driver library for the given description (which appears to map
|
|
|
|
* to one of the HKLM/Software/ODBC/ODBCINST.INI keys). (If you do this note
|
|
|
|
* that this will add a requirement that this function be called after
|
|
|
|
* ODBC_ReplicateODBCInstToRegistry)
|
|
|
|
*/
|
|
|
|
static void ODBC_ReplicateODBCToRegistry (int is_user, SQLHENV hEnv)
|
|
|
|
{
|
|
|
|
HKEY hODBC;
|
|
|
|
LONG reg_ret;
|
|
|
|
SQLRETURN sql_ret;
|
|
|
|
SQLUSMALLINT dirn;
|
2005-08-29 11:38:19 +02:00
|
|
|
CHAR dsn [SQL_MAX_DSN_LENGTH + 1];
|
2004-10-19 00:47:14 +02:00
|
|
|
SQLSMALLINT sizedsn;
|
2005-08-29 11:38:19 +02:00
|
|
|
CHAR desc [256];
|
2004-10-19 00:47:14 +02:00
|
|
|
SQLSMALLINT sizedesc;
|
|
|
|
int success;
|
|
|
|
const char *which = is_user ? "user" : "system";
|
|
|
|
|
|
|
|
success = 0;
|
|
|
|
if ((reg_ret = RegCreateKeyExA (
|
|
|
|
is_user ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
|
|
|
|
"Software\\ODBC\\ODBC.INI", 0, NULL, REG_OPTION_NON_VOLATILE,
|
|
|
|
KEY_ALL_ACCESS /* a couple more than we need */, NULL, &hODBC,
|
|
|
|
NULL)) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
success = 1;
|
|
|
|
dirn = is_user ? SQL_FETCH_FIRST_USER : SQL_FETCH_FIRST_SYSTEM;
|
|
|
|
while ((sql_ret = SQLDataSources (hEnv, dirn,
|
2005-08-29 11:38:19 +02:00
|
|
|
(SQLCHAR*)dsn, sizeof(dsn), &sizedsn,
|
|
|
|
(SQLCHAR*)desc, sizeof(desc), &sizedesc)) == SQL_SUCCESS
|
2004-10-19 00:47:14 +02:00
|
|
|
|| sql_ret == SQL_SUCCESS_WITH_INFO)
|
|
|
|
{
|
|
|
|
/* FIXME Do some proper handling of the SUCCESS_WITH_INFO */
|
|
|
|
dirn = SQL_FETCH_NEXT;
|
2008-10-25 17:43:47 +02:00
|
|
|
if (sizedsn == lstrlenA(dsn) && sizedesc == lstrlenA(desc))
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
|
|
|
HKEY hDSN;
|
|
|
|
if ((reg_ret = RegCreateKeyExA (hODBC, dsn, 0,
|
|
|
|
NULL, REG_OPTION_NON_VOLATILE,
|
|
|
|
KEY_ALL_ACCESS, NULL, &hDSN, NULL))
|
|
|
|
== ERROR_SUCCESS)
|
|
|
|
{
|
2007-02-21 15:45:21 +01:00
|
|
|
static const char DRIVERKEY[] = "Driver";
|
2004-10-19 00:47:14 +02:00
|
|
|
if ((reg_ret = RegQueryValueExA (hDSN, DRIVERKEY,
|
|
|
|
NULL, NULL, NULL, NULL))
|
|
|
|
== ERROR_FILE_NOT_FOUND)
|
|
|
|
{
|
|
|
|
if ((reg_ret = RegSetValueExA (hDSN, DRIVERKEY, 0,
|
2005-08-29 11:38:19 +02:00
|
|
|
REG_SZ, (LPBYTE)desc, sizedesc)) != ERROR_SUCCESS)
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d replicating description of "
|
2004-10-19 00:47:14 +02:00
|
|
|
"%s(%s)\n", reg_ret, dsn, desc);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (reg_ret != ERROR_SUCCESS)
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d checking for description of %s\n",
|
2004-10-19 00:47:14 +02:00
|
|
|
reg_ret, dsn);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
if ((reg_ret = RegCloseKey (hDSN)) != ERROR_SUCCESS)
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d closing %s DSN key %s\n",
|
2004-10-19 00:47:14 +02:00
|
|
|
reg_ret, which, dsn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d opening %s DSN key %s\n",
|
2004-10-19 00:47:14 +02:00
|
|
|
reg_ret, which, dsn);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WARN ("Unusually long %s data source name %s (%s) not "
|
|
|
|
"replicated\n", which, dsn, desc);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sql_ret != SQL_NO_DATA)
|
|
|
|
{
|
|
|
|
TRACE ("Error %d enumerating %s datasources\n",
|
|
|
|
(int)sql_ret, which);
|
|
|
|
success = 0;
|
|
|
|
}
|
|
|
|
if ((reg_ret = RegCloseKey (hODBC)) != ERROR_SUCCESS)
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d closing %s ODBC.INI registry key\n", reg_ret,
|
2004-10-19 00:47:14 +02:00
|
|
|
which);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE ("Error %d creating/opening %s ODBC.INI registry key\n",
|
2004-10-19 00:47:14 +02:00
|
|
|
reg_ret, which);
|
|
|
|
}
|
|
|
|
if (!success)
|
|
|
|
{
|
|
|
|
WARN ("May not have replicated all %s ODBC DSNs to the registry\n",
|
|
|
|
which);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ODBC_ReplicateToRegistry
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* Unfortunately some of the functions that Windows documents as being part
|
|
|
|
* of the ODBC API it implements directly during compilation or something
|
|
|
|
* in terms of registry access functions.
|
|
|
|
* e.g. SQLGetInstalledDrivers queries the list at
|
|
|
|
* HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers
|
|
|
|
*
|
|
|
|
* This function is called when the driver manager is loaded and is used
|
|
|
|
* to replicate the appropriate details into the Wine registry
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void ODBC_ReplicateToRegistry (void)
|
|
|
|
{
|
|
|
|
SQLRETURN sql_ret;
|
|
|
|
SQLHENV hEnv;
|
|
|
|
|
|
|
|
if ((sql_ret = SQLAllocEnv (&hEnv)) == SQL_SUCCESS)
|
|
|
|
{
|
|
|
|
ODBC_ReplicateODBCInstToRegistry (hEnv);
|
|
|
|
ODBC_ReplicateODBCToRegistry (0 /* system dsns */, hEnv);
|
|
|
|
ODBC_ReplicateODBCToRegistry (1 /* user dsns */, hEnv);
|
|
|
|
|
|
|
|
if ((sql_ret = SQLFreeEnv (hEnv)) != SQL_SUCCESS)
|
|
|
|
{
|
|
|
|
TRACE ("Error %d freeing the SQL environment.\n", (int)sql_ret);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE ("Error %d opening an SQL environment.\n", (int)sql_ret);
|
|
|
|
WARN ("The external ODBC settings have not been replicated to the"
|
|
|
|
" Wine registry\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-12-12 00:56:46 +01:00
|
|
|
/***********************************************************************
|
2002-11-05 00:53:41 +01:00
|
|
|
* DllMain [Internal] Initializes the internal 'ODBC32.DLL'.
|
1999-12-12 00:56:46 +01:00
|
|
|
*
|
|
|
|
* PARAMS
|
2000-07-16 17:44:22 +02:00
|
|
|
* hinstDLL [I] handle to the DLL's instance
|
1999-12-12 00:56:46 +01:00
|
|
|
* fdwReason [I]
|
2000-07-16 17:44:22 +02:00
|
|
|
* lpvReserved [I] reserved, must be NULL
|
1999-12-12 00:56:46 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*/
|
|
|
|
|
2002-11-05 00:53:41 +01:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2006-10-09 21:21:22 +02:00
|
|
|
TRACE("Initializing or Finalizing proxy ODBC: %p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
|
|
|
{
|
|
|
|
TRACE("Loading ODBC...\n");
|
2003-06-30 22:53:48 +02:00
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
1999-12-12 00:56:46 +01:00
|
|
|
if (ODBC_LoadDriverManager())
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
1999-12-12 00:56:46 +01:00
|
|
|
ODBC_LoadDMFunctions();
|
2004-10-19 00:47:14 +02:00
|
|
|
ODBC_ReplicateToRegistry();
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
else if (fdwReason == DLL_PROCESS_DETACH)
|
|
|
|
{
|
|
|
|
TRACE("Unloading ODBC...\n");
|
2009-10-03 14:40:19 +02:00
|
|
|
if (dmHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2009-10-03 14:40:19 +02:00
|
|
|
wine_dlclose(dmHandle,NULL,0);
|
|
|
|
dmHandle = NULL;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ODBC_LoadDriverManager [Internal] Load ODBC library.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*/
|
|
|
|
|
2001-10-02 22:28:06 +02:00
|
|
|
static BOOL ODBC_LoadDriverManager(void)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
const char *s = getenv("LIB_ODBC_DRIVER_MANAGER");
|
2000-12-13 22:32:55 +01:00
|
|
|
char error[256];
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
|
2008-01-07 17:16:29 +01:00
|
|
|
#ifdef SONAME_LIBODBC
|
|
|
|
if (!s || !s[0]) s = SONAME_LIBODBC;
|
|
|
|
#endif
|
|
|
|
if (!s || !s[0]) goto failed;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
dmHandle = wine_dlopen(s, RTLD_LAZY | RTLD_GLOBAL, error, sizeof(error));
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (dmHandle != NULL)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2009-10-03 14:40:19 +02:00
|
|
|
nErrorType = ERROR_FREE;
|
1999-12-12 00:56:46 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
2008-01-07 17:16:29 +01:00
|
|
|
failed:
|
|
|
|
WARN("failed to open library %s: %s\n", debugstr_a(s), error);
|
2009-10-03 14:40:19 +02:00
|
|
|
nErrorType = ERROR_LIBRARY_NOT_FOUND;
|
2008-01-07 17:16:29 +01:00
|
|
|
return FALSE;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ODBC_LoadDMFunctions [Internal] Populate function table.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*/
|
|
|
|
|
2001-10-02 22:28:06 +02:00
|
|
|
static BOOL ODBC_LoadDMFunctions(void)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2000-12-13 22:32:55 +01:00
|
|
|
char error[256];
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (dmHandle == NULL)
|
1999-12-12 00:56:46 +01:00
|
|
|
return FALSE;
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
#define LOAD_FUNC(name) \
|
|
|
|
if ((p##name = wine_dlsym( dmHandle, #name, error, sizeof(error) ))); \
|
|
|
|
else WARN( "Failed to load %s: %s\n", #name, error )
|
|
|
|
|
|
|
|
LOAD_FUNC(SQLAllocConnect);
|
|
|
|
LOAD_FUNC(SQLAllocEnv);
|
|
|
|
LOAD_FUNC(SQLAllocHandle);
|
|
|
|
LOAD_FUNC(SQLAllocHandleStd);
|
|
|
|
LOAD_FUNC(SQLAllocStmt);
|
|
|
|
LOAD_FUNC(SQLBindCol);
|
|
|
|
LOAD_FUNC(SQLBindParam);
|
|
|
|
LOAD_FUNC(SQLBindParameter);
|
|
|
|
LOAD_FUNC(SQLBrowseConnect);
|
|
|
|
LOAD_FUNC(SQLBrowseConnectW);
|
|
|
|
LOAD_FUNC(SQLBulkOperations);
|
|
|
|
LOAD_FUNC(SQLCancel);
|
|
|
|
LOAD_FUNC(SQLCloseCursor);
|
|
|
|
LOAD_FUNC(SQLColAttribute);
|
|
|
|
LOAD_FUNC(SQLColAttributeW);
|
|
|
|
LOAD_FUNC(SQLColAttributes);
|
|
|
|
LOAD_FUNC(SQLColAttributesW);
|
|
|
|
LOAD_FUNC(SQLColumnPrivileges);
|
|
|
|
LOAD_FUNC(SQLColumnPrivilegesW);
|
|
|
|
LOAD_FUNC(SQLColumns);
|
|
|
|
LOAD_FUNC(SQLColumnsW);
|
|
|
|
LOAD_FUNC(SQLConnect);
|
|
|
|
LOAD_FUNC(SQLConnectW);
|
|
|
|
LOAD_FUNC(SQLCopyDesc);
|
|
|
|
LOAD_FUNC(SQLDataSources);
|
|
|
|
LOAD_FUNC(SQLDataSourcesW);
|
|
|
|
LOAD_FUNC(SQLDescribeCol);
|
|
|
|
LOAD_FUNC(SQLDescribeColW);
|
|
|
|
LOAD_FUNC(SQLDescribeParam);
|
|
|
|
LOAD_FUNC(SQLDisconnect);
|
|
|
|
LOAD_FUNC(SQLDriverConnect);
|
|
|
|
LOAD_FUNC(SQLDriverConnectW);
|
|
|
|
LOAD_FUNC(SQLDrivers);
|
|
|
|
LOAD_FUNC(SQLDriversW);
|
|
|
|
LOAD_FUNC(SQLEndTran);
|
|
|
|
LOAD_FUNC(SQLError);
|
|
|
|
LOAD_FUNC(SQLErrorW);
|
|
|
|
LOAD_FUNC(SQLExecDirect);
|
|
|
|
LOAD_FUNC(SQLExecDirectW);
|
|
|
|
LOAD_FUNC(SQLExecute);
|
|
|
|
LOAD_FUNC(SQLExtendedFetch);
|
|
|
|
LOAD_FUNC(SQLFetch);
|
|
|
|
LOAD_FUNC(SQLFetchScroll);
|
|
|
|
LOAD_FUNC(SQLForeignKeys);
|
|
|
|
LOAD_FUNC(SQLForeignKeysW);
|
|
|
|
LOAD_FUNC(SQLFreeConnect);
|
|
|
|
LOAD_FUNC(SQLFreeEnv);
|
|
|
|
LOAD_FUNC(SQLFreeHandle);
|
|
|
|
LOAD_FUNC(SQLFreeStmt);
|
|
|
|
LOAD_FUNC(SQLGetConnectAttr);
|
|
|
|
LOAD_FUNC(SQLGetConnectAttrW);
|
|
|
|
LOAD_FUNC(SQLGetConnectOption);
|
|
|
|
LOAD_FUNC(SQLGetConnectOptionW);
|
|
|
|
LOAD_FUNC(SQLGetCursorName);
|
|
|
|
LOAD_FUNC(SQLGetCursorNameW);
|
|
|
|
LOAD_FUNC(SQLGetData);
|
|
|
|
LOAD_FUNC(SQLGetDescField);
|
|
|
|
LOAD_FUNC(SQLGetDescFieldW);
|
|
|
|
LOAD_FUNC(SQLGetDescRec);
|
|
|
|
LOAD_FUNC(SQLGetDescRecW);
|
|
|
|
LOAD_FUNC(SQLGetDiagField);
|
|
|
|
LOAD_FUNC(SQLGetDiagFieldW);
|
|
|
|
LOAD_FUNC(SQLGetDiagRec);
|
|
|
|
LOAD_FUNC(SQLGetDiagRecW);
|
|
|
|
LOAD_FUNC(SQLGetEnvAttr);
|
|
|
|
LOAD_FUNC(SQLGetFunctions);
|
|
|
|
LOAD_FUNC(SQLGetInfo);
|
|
|
|
LOAD_FUNC(SQLGetInfoW);
|
|
|
|
LOAD_FUNC(SQLGetStmtAttr);
|
|
|
|
LOAD_FUNC(SQLGetStmtAttrW);
|
|
|
|
LOAD_FUNC(SQLGetStmtOption);
|
|
|
|
LOAD_FUNC(SQLGetTypeInfo);
|
|
|
|
LOAD_FUNC(SQLGetTypeInfoW);
|
|
|
|
LOAD_FUNC(SQLMoreResults);
|
|
|
|
LOAD_FUNC(SQLNativeSql);
|
|
|
|
LOAD_FUNC(SQLNativeSqlW);
|
|
|
|
LOAD_FUNC(SQLNumParams);
|
|
|
|
LOAD_FUNC(SQLNumResultCols);
|
|
|
|
LOAD_FUNC(SQLParamData);
|
|
|
|
LOAD_FUNC(SQLParamOptions);
|
|
|
|
LOAD_FUNC(SQLPrepare);
|
|
|
|
LOAD_FUNC(SQLPrepareW);
|
|
|
|
LOAD_FUNC(SQLPrimaryKeys);
|
|
|
|
LOAD_FUNC(SQLPrimaryKeysW);
|
|
|
|
LOAD_FUNC(SQLProcedureColumns);
|
|
|
|
LOAD_FUNC(SQLProcedureColumnsW);
|
|
|
|
LOAD_FUNC(SQLProcedures);
|
|
|
|
LOAD_FUNC(SQLProceduresW);
|
|
|
|
LOAD_FUNC(SQLPutData);
|
|
|
|
LOAD_FUNC(SQLRowCount);
|
|
|
|
LOAD_FUNC(SQLSetConnectAttr);
|
|
|
|
LOAD_FUNC(SQLSetConnectAttrW);
|
|
|
|
LOAD_FUNC(SQLSetConnectOption);
|
|
|
|
LOAD_FUNC(SQLSetConnectOptionW);
|
|
|
|
LOAD_FUNC(SQLSetCursorName);
|
|
|
|
LOAD_FUNC(SQLSetCursorNameW);
|
|
|
|
LOAD_FUNC(SQLSetDescField);
|
|
|
|
LOAD_FUNC(SQLSetDescFieldW);
|
|
|
|
LOAD_FUNC(SQLSetDescRec);
|
|
|
|
LOAD_FUNC(SQLSetEnvAttr);
|
|
|
|
LOAD_FUNC(SQLSetParam);
|
|
|
|
LOAD_FUNC(SQLSetPos);
|
|
|
|
LOAD_FUNC(SQLSetScrollOptions);
|
|
|
|
LOAD_FUNC(SQLSetStmtAttr);
|
|
|
|
LOAD_FUNC(SQLSetStmtAttrW);
|
|
|
|
LOAD_FUNC(SQLSetStmtOption);
|
|
|
|
LOAD_FUNC(SQLSpecialColumns);
|
|
|
|
LOAD_FUNC(SQLSpecialColumnsW);
|
|
|
|
LOAD_FUNC(SQLStatistics);
|
|
|
|
LOAD_FUNC(SQLStatisticsW);
|
|
|
|
LOAD_FUNC(SQLTablePrivileges);
|
|
|
|
LOAD_FUNC(SQLTablePrivilegesW);
|
|
|
|
LOAD_FUNC(SQLTables);
|
|
|
|
LOAD_FUNC(SQLTablesW);
|
|
|
|
LOAD_FUNC(SQLTransact);
|
|
|
|
#undef LOAD_FUNC
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocConnect [ODBC32.001]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("Env=%lx\n",EnvironmentHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLAllocConnect)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
*ConnectionHandle = SQL_NULL_HDBC;
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Not ready\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLAllocConnect(EnvironmentHandle, ConnectionHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Returns ret=%d, Handle %lx\n",ret, *ConnectionHandle);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocEnv [ODBC32.002]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLAllocEnv)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
*EnvironmentHandle = SQL_NULL_HENV;
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Not ready\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLAllocEnv(EnvironmentHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Returns ret=%d, Env=%lx\n",ret, *EnvironmentHandle);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocHandle [ODBC32.024]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("(Type=%d, Handle=%lx)\n",HandleType,InputHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLAllocHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2009-10-03 14:40:19 +02:00
|
|
|
if (nErrorType == ERROR_LIBRARY_NOT_FOUND)
|
2005-05-06 17:44:31 +02:00
|
|
|
WARN("ProxyODBC: Cannot load ODBC driver manager library.\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
if (HandleType == SQL_HANDLE_ENV)
|
|
|
|
*OutputHandle = SQL_NULL_HENV;
|
|
|
|
else if (HandleType == SQL_HANDLE_DBC)
|
|
|
|
*OutputHandle = SQL_NULL_HDBC;
|
|
|
|
else if (HandleType == SQL_HANDLE_STMT)
|
|
|
|
*OutputHandle = SQL_NULL_HSTMT;
|
|
|
|
else if (HandleType == SQL_HANDLE_DESC)
|
|
|
|
*OutputHandle = SQL_NULL_HDESC;
|
|
|
|
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE ("Not ready\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLAllocHandle(HandleType, InputHandle, OutputHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Returns ret=%d, Handle=%lx\n",ret, *OutputHandle);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocStmt [ODBC32.003]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("(Connection=%lx)\n",ConnectionHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLAllocStmt)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
*StatementHandle = SQL_NULL_HSTMT;
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE ("Not ready\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLAllocStmt(ConnectionHandle, StatementHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE ("Returns ret=%d, Handle=%lx\n", ret, *StatementHandle);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocHandleStd [ODBC32.077]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocHandleStd( SQLSMALLINT HandleType,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2008-01-16 12:20:50 +01:00
|
|
|
TRACE("ProxyODBC: SQLAllocHandleStd.\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLAllocHandleStd)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2009-10-03 14:40:19 +02:00
|
|
|
if (nErrorType == ERROR_LIBRARY_NOT_FOUND)
|
2005-05-06 17:44:31 +02:00
|
|
|
WARN("ProxyODBC: Cannot load ODBC driver manager library.\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
if (HandleType == SQL_HANDLE_ENV)
|
|
|
|
*OutputHandle = SQL_NULL_HENV;
|
|
|
|
else if (HandleType == SQL_HANDLE_DBC)
|
|
|
|
*OutputHandle = SQL_NULL_HDBC;
|
|
|
|
else if (HandleType == SQL_HANDLE_STMT)
|
|
|
|
*OutputHandle = SQL_NULL_HSTMT;
|
|
|
|
else if (HandleType == SQL_HANDLE_DESC)
|
|
|
|
*OutputHandle = SQL_NULL_HDESC;
|
|
|
|
|
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
return pSQLAllocHandleStd(HandleType, InputHandle, OutputHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBindCol [ODBC32.004]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
|
|
|
|
SQLPOINTER TargetValue, SQLINTEGER BufferLength,
|
|
|
|
SQLINTEGER *StrLen_or_Ind)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLBindCol)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE ("Not ready\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
return pSQLBindCol(StatementHandle, ColumnNumber, TargetType,
|
|
|
|
TargetValue, BufferLength, StrLen_or_Ind);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBindParam [ODBC32.025]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
|
|
|
|
SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
|
|
|
|
SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
|
|
|
|
SQLINTEGER *StrLen_or_Ind)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLBindParam) return SQL_ERROR;
|
|
|
|
return pSQLBindParam(StatementHandle, ParameterNumber, ValueType,
|
|
|
|
ParameterType, LengthPrecision, ParameterScale,
|
|
|
|
ParameterValue, StrLen_or_Ind);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLCancel [ODBC32.005]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLCancel) return SQL_ERROR;
|
|
|
|
return pSQLCancel(StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLCloseCursor [ODBC32.026]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("(Handle=%lx)\n",StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLCloseCursor) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLCloseCursor(StatementHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("returns %d\n",ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttribute [ODBC32.027]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLColAttribute (SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColAttribute) return SQL_ERROR;
|
|
|
|
return pSQLColAttribute(StatementHandle, ColumnNumber, FieldIdentifier,
|
|
|
|
CharacterAttribute, BufferLength, StringLength, NumericAttribute);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumns [ODBC32.040]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
|
|
|
|
SQLCHAR *TableName, SQLSMALLINT NameLength3,
|
|
|
|
SQLCHAR *ColumnName, SQLSMALLINT NameLength4)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColumns) return SQL_ERROR;
|
|
|
|
return pSQLColumns(StatementHandle, CatalogName, NameLength1,
|
|
|
|
SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLConnect [ODBC32.007]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLCHAR *ServerName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *UserName, SQLSMALLINT NameLength2,
|
|
|
|
SQLCHAR *Authentication, SQLSMALLINT NameLength3)
|
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("(Server=%.*s)\n",NameLength1, ServerName);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLConnect) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLConnect(ConnectionHandle, ServerName, NameLength1,
|
|
|
|
UserName, NameLength2, Authentication, NameLength3);
|
2001-10-02 22:28:06 +02:00
|
|
|
|
|
|
|
TRACE("returns %d\n",ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLCopyDesc [ODBC32.028]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLCopyDesc) return SQL_ERROR;
|
|
|
|
return pSQLCopyDesc(SourceDescHandle, TargetDescHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDataSources [ODBC32.057]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT Direction, SQLCHAR *ServerName,
|
|
|
|
SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
|
|
|
|
SQLCHAR *Description, SQLSMALLINT BufferLength2,
|
|
|
|
SQLSMALLINT *NameLength2)
|
|
|
|
{
|
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("EnvironmentHandle = %p\n", (LPVOID)EnvironmentHandle);
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDataSources) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLDataSources(EnvironmentHandle, Direction, ServerName,
|
|
|
|
BufferLength1, NameLength1, Description, BufferLength2, NameLength2);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
if (TRACE_ON(odbc))
|
|
|
|
{
|
|
|
|
TRACE("returns: %d \t", ret);
|
|
|
|
if (*NameLength1 > 0)
|
2003-03-15 01:12:42 +01:00
|
|
|
TRACE("DataSource = %s,", ServerName);
|
1999-12-12 00:56:46 +01:00
|
|
|
if (*NameLength2 > 0)
|
2003-03-15 01:12:42 +01:00
|
|
|
TRACE(" Description = %s", Description);
|
|
|
|
TRACE("\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDescribeCol [ODBC32.008]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
|
|
|
|
SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
|
|
|
|
SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDescribeCol) return SQL_ERROR;
|
|
|
|
return pSQLDescribeCol(StatementHandle, ColumnNumber, ColumnName,
|
|
|
|
BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDisconnect [ODBC32.009]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("(Handle=%lx)\n", ConnectionHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDisconnect) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLDisconnect(ConnectionHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("returns %d\n",ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLEndTran [ODBC32.029]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLEndTran) return SQL_ERROR;
|
|
|
|
return pSQLEndTran(HandleType, Handle, CompletionType);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLError [ODBC32.010]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
|
|
|
|
SQLCHAR *Sqlstate, SQLINTEGER *NativeError,
|
|
|
|
SQLCHAR *MessageText, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *TextLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLError) return SQL_ERROR;
|
|
|
|
return pSQLError(EnvironmentHandle, ConnectionHandle, StatementHandle,
|
|
|
|
Sqlstate, NativeError, MessageText, BufferLength, TextLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExecDirect [ODBC32.011]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLExecDirect) return SQL_ERROR;
|
|
|
|
return pSQLExecDirect(StatementHandle, StatementText, TextLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExecute [ODBC32.012]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLExecute) return SQL_ERROR;
|
|
|
|
return pSQLExecute(StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFetch [ODBC32.013]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLFetch) return SQL_ERROR;
|
|
|
|
return pSQLFetch(StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFetchScroll [ODBC32.030]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLFetchScroll) return SQL_ERROR;
|
|
|
|
return pSQLFetchScroll(StatementHandle, FetchOrientation, FetchOffset);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeConnect [ODBC32.014]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("(Handle=%lx)\n",ConnectionHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLFreeConnect) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLFreeConnect(ConnectionHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Returns %d\n",ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeEnv [ODBC32.015]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
SQLRETURN ret;
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("(Env=%lx)\n",EnvironmentHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLFreeEnv) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLFreeEnv(EnvironmentHandle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Returns %d\n",ret);
|
1999-12-12 00:56:46 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeHandle [ODBC32.031]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
SQLRETURN ret;
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("(Type=%d, Handle=%lx)\n",HandleType,Handle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLFreeHandle) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLFreeHandle(HandleType, Handle);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE ("Returns %d\n",ret);
|
1999-12-12 00:56:46 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeStmt [ODBC32.016]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2001-10-02 22:28:06 +02:00
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("(Handle %lx, Option=%d)\n",StatementHandle, Option);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLFreeStmt) return SQL_ERROR;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLFreeStmt(StatementHandle, Option);
|
2001-10-02 22:28:06 +02:00
|
|
|
TRACE("Returns %d\n",ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectAttr [ODBC32.032]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetConnectAttr) return SQL_ERROR;
|
|
|
|
return pSQLGetConnectAttr(ConnectionHandle, Attribute, Value,
|
|
|
|
BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectOption [ODBC32.042]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetConnectOption) return SQL_ERROR;
|
|
|
|
return pSQLGetConnectOption(ConnectionHandle, Option, Value);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetCursorName [ODBC32.017]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLCHAR *CursorName, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *NameLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetCursorName) return SQL_ERROR;
|
|
|
|
return pSQLGetCursorName(StatementHandle, CursorName, BufferLength, NameLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetData [ODBC32.043]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
|
|
|
|
SQLPOINTER TargetValue, SQLINTEGER BufferLength,
|
|
|
|
SQLINTEGER *StrLen_or_Ind)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetData) return SQL_ERROR;
|
|
|
|
return pSQLGetData(StatementHandle, ColumnNumber, TargetType,
|
|
|
|
TargetValue, BufferLength, StrLen_or_Ind);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescField [ODBC32.033]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength,
|
|
|
|
SQLINTEGER *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDescField) return SQL_ERROR;
|
|
|
|
return pSQLGetDescField(DescriptorHandle, RecNumber, FieldIdentifier,
|
|
|
|
Value, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescRec [ODBC32.034]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLSMALLINT RecNumber, SQLCHAR *Name,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
|
|
|
|
SQLSMALLINT *Type, SQLSMALLINT *SubType,
|
|
|
|
SQLINTEGER *Length, SQLSMALLINT *Precision,
|
|
|
|
SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDescRec) return SQL_ERROR;
|
|
|
|
return pSQLGetDescRec(DescriptorHandle, RecNumber, Name, BufferLength,
|
|
|
|
StringLength, Type, SubType, Length, Precision, Scale, Nullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagField [ODBC32.035]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
|
|
|
|
SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDiagField) return SQL_ERROR;
|
|
|
|
return pSQLGetDiagField(HandleType, Handle, RecNumber, DiagIdentifier,
|
|
|
|
DiagInfo, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagRec [ODBC32.036]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLSMALLINT RecNumber, SQLCHAR *Sqlstate,
|
|
|
|
SQLINTEGER *NativeError, SQLCHAR *MessageText,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDiagRec) return SQL_ERROR;
|
|
|
|
return pSQLGetDiagRec(HandleType, Handle, RecNumber, Sqlstate, NativeError,
|
|
|
|
MessageText, BufferLength, TextLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetEnvAttr [ODBC32.037]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetEnvAttr) return SQL_ERROR;
|
|
|
|
return pSQLGetEnvAttr(EnvironmentHandle, Attribute, Value, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetFunctions [ODBC32.044]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetFunctions) return SQL_ERROR;
|
|
|
|
return pSQLGetFunctions(ConnectionHandle, FunctionId, Supported);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetInfo [ODBC32.045]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetInfo) return SQL_ERROR;
|
|
|
|
return pSQLGetInfo(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
2000-03-24 21:46:04 +01:00
|
|
|
* SQLGetStmtAttr [ODBC32.038]
|
1999-12-12 00:56:46 +01:00
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetStmtAttr) return SQL_ERROR;
|
|
|
|
return pSQLGetStmtAttr(StatementHandle, Attribute, Value, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetStmtOption [ODBC32.046]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetStmtOption) return SQL_ERROR;
|
|
|
|
return pSQLGetStmtOption(StatementHandle, Option, Value);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
2000-03-24 21:46:04 +01:00
|
|
|
* SQLGetTypeInfo [ODBC32.047]
|
1999-12-12 00:56:46 +01:00
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetTypeInfo) return SQL_ERROR;
|
|
|
|
return pSQLGetTypeInfo(StatementHandle, DataType);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNumResultCols [ODBC32.018]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLNumResultCols) return SQL_ERROR;
|
|
|
|
return pSQLNumResultCols(StatementHandle, ColumnCount);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLParamData [ODBC32.048]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLParamData) return SQL_ERROR;
|
|
|
|
return pSQLParamData(StatementHandle, Value);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrepare [ODBC32.019]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLPrepare) return SQL_ERROR;
|
|
|
|
return pSQLPrepare(StatementHandle, StatementText, TextLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPutData [ODBC32.049]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLINTEGER StrLen_or_Ind)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLPutData) return SQL_ERROR;
|
|
|
|
return pSQLPutData(StatementHandle, Data, StrLen_or_Ind);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLRowCount [ODBC32.020]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLINTEGER *RowCount)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLRowCount) return SQL_ERROR;
|
|
|
|
return pSQLRowCount(StatementHandle, RowCount);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectAttr [ODBC32.039]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLPOINTER Value, SQLINTEGER StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetConnectAttr) return SQL_ERROR;
|
|
|
|
return pSQLSetConnectAttr(ConnectionHandle, Attribute, Value, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectOption [ODBC32.050]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLUINTEGER Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetConnectOption) return SQL_ERROR;
|
|
|
|
return pSQLSetConnectOption(ConnectionHandle, Option, Value);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetCursorName [ODBC32.021]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetCursorName) return SQL_ERROR;
|
|
|
|
return pSQLSetCursorName(StatementHandle, CursorName, NameLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetDescField [ODBC32.073]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetDescField) return SQL_ERROR;
|
|
|
|
return pSQLSetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetDescRec [ODBC32.074]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLSMALLINT RecNumber, SQLSMALLINT Type,
|
|
|
|
SQLSMALLINT SubType, SQLINTEGER Length,
|
|
|
|
SQLSMALLINT Precision, SQLSMALLINT Scale,
|
|
|
|
SQLPOINTER Data, SQLINTEGER *StringLength,
|
|
|
|
SQLINTEGER *Indicator)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetDescRec) return SQL_ERROR;
|
|
|
|
return pSQLSetDescRec(DescriptorHandle, RecNumber, Type, SubType, Length,
|
|
|
|
Precision, Scale, Data, StringLength, Indicator);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetEnvAttr [ODBC32.075]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetEnvAttr) return SQL_ERROR;
|
|
|
|
return pSQLSetEnvAttr(EnvironmentHandle, Attribute, Value, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetParam [ODBC32.022]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
|
|
|
|
SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
|
|
|
|
SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
|
|
|
|
SQLINTEGER *StrLen_or_Ind)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetParam) return SQL_ERROR;
|
|
|
|
return pSQLSetParam(StatementHandle, ParameterNumber, ValueType, ParameterType, LengthPrecision,
|
|
|
|
ParameterScale, ParameterValue, StrLen_or_Ind);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetStmtAttr [ODBC32.076]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetStmtAttr) return SQL_ERROR;
|
|
|
|
return pSQLSetStmtAttr(StatementHandle, Attribute, Value, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetStmtOption [ODBC32.051]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLUINTEGER Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetStmtOption) return SQL_ERROR;
|
|
|
|
return pSQLSetStmtOption(StatementHandle, Option, Value);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSpecialColumns [ODBC32.052]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
|
|
|
|
SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
|
|
|
|
SQLSMALLINT NameLength2, SQLCHAR *TableName,
|
|
|
|
SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
|
|
|
|
SQLUSMALLINT Nullable)
|
|
|
|
{
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSpecialColumns) return SQL_ERROR;
|
|
|
|
return pSQLSpecialColumns(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName,
|
|
|
|
NameLength2, TableName, NameLength3, Scope, Nullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
2000-03-24 21:46:04 +01:00
|
|
|
* SQLStatistics [ODBC32.053]
|
1999-12-12 00:56:46 +01:00
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
|
|
|
|
SQLCHAR *TableName, SQLSMALLINT NameLength3,
|
|
|
|
SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLStatistics) return SQL_ERROR;
|
|
|
|
return pSQLStatistics(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2,
|
|
|
|
TableName, NameLength3, Unique, Reserved);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTables [ODBC32.054]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
|
|
|
|
SQLCHAR *TableName, SQLSMALLINT NameLength3,
|
|
|
|
SQLCHAR *TableType, SQLSMALLINT NameLength4)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLTables) return SQL_ERROR;
|
|
|
|
return pSQLTables(StatementHandle, CatalogName, NameLength1,
|
|
|
|
SchemaName, NameLength2, TableName, NameLength3, TableType, NameLength4);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTransact [ODBC32.023]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle,
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLUSMALLINT CompletionType)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLTransact) return SQL_ERROR;
|
|
|
|
return pSQLTransact(EnvironmentHandle, ConnectionHandle, CompletionType);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBrowseConnect [ODBC32.055]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLBrowseConnect(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHDBC hdbc,
|
|
|
|
SQLCHAR *szConnStrIn,
|
|
|
|
SQLSMALLINT cbConnStrIn,
|
|
|
|
SQLCHAR *szConnStrOut,
|
|
|
|
SQLSMALLINT cbConnStrOutMax,
|
|
|
|
SQLSMALLINT *pcbConnStrOut)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLBrowseConnect) return SQL_ERROR;
|
|
|
|
return pSQLBrowseConnect(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBulkOperations [ODBC32.078]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLBulkOperations(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT StatementHandle,
|
|
|
|
SQLSMALLINT Operation)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLBulkOperations) return SQL_ERROR;
|
|
|
|
return pSQLBulkOperations(StatementHandle, Operation);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttributes [ODBC32.006]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLColAttributes(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLUSMALLINT icol,
|
|
|
|
SQLUSMALLINT fDescType,
|
|
|
|
SQLPOINTER rgbDesc,
|
|
|
|
SQLSMALLINT cbDescMax,
|
|
|
|
SQLSMALLINT *pcbDesc,
|
|
|
|
SQLINTEGER *pfDesc)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColAttributes) return SQL_ERROR;
|
|
|
|
return pSQLColAttributes(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumnPrivileges [ODBC32.056]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLColumnPrivileges(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLCHAR *szCatalogName,
|
|
|
|
SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName,
|
|
|
|
SQLSMALLINT cbSchemaName,
|
|
|
|
SQLCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName,
|
|
|
|
SQLCHAR *szColumnName,
|
|
|
|
SQLSMALLINT cbColumnName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColumnPrivileges) return SQL_ERROR;
|
|
|
|
return pSQLColumnPrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szTableName, cbTableName, szColumnName, cbColumnName);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDescribeParam [ODBC32.058]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLDescribeParam(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLUSMALLINT ipar,
|
|
|
|
SQLSMALLINT *pfSqlType,
|
|
|
|
SQLUINTEGER *pcbParamDef,
|
|
|
|
SQLSMALLINT *pibScale,
|
|
|
|
SQLSMALLINT *pfNullable)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDescribeParam) return SQL_ERROR;
|
|
|
|
return pSQLDescribeParam(hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExtendedFetch [ODBC32.059]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLExtendedFetch(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLUSMALLINT fFetchType,
|
|
|
|
SQLINTEGER irow,
|
|
|
|
SQLUINTEGER *pcrow,
|
|
|
|
SQLUSMALLINT *rgfRowStatus)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLExtendedFetch) return SQL_ERROR;
|
|
|
|
return pSQLExtendedFetch(hstmt, fFetchType, irow, pcrow, rgfRowStatus);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLForeignKeys [ODBC32.060]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLForeignKeys(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLCHAR *szPkCatalogName,
|
|
|
|
SQLSMALLINT cbPkCatalogName,
|
|
|
|
SQLCHAR *szPkSchemaName,
|
|
|
|
SQLSMALLINT cbPkSchemaName,
|
|
|
|
SQLCHAR *szPkTableName,
|
|
|
|
SQLSMALLINT cbPkTableName,
|
|
|
|
SQLCHAR *szFkCatalogName,
|
|
|
|
SQLSMALLINT cbFkCatalogName,
|
|
|
|
SQLCHAR *szFkSchemaName,
|
|
|
|
SQLSMALLINT cbFkSchemaName,
|
|
|
|
SQLCHAR *szFkTableName,
|
|
|
|
SQLSMALLINT cbFkTableName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLForeignKeys) return SQL_ERROR;
|
|
|
|
return pSQLForeignKeys(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName,
|
|
|
|
szPkTableName, cbPkTableName, szFkCatalogName, cbFkCatalogName,
|
|
|
|
szFkSchemaName, cbFkSchemaName, szFkTableName, cbFkTableName);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLMoreResults [ODBC32.061]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLMoreResults(SQLHSTMT hstmt)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLMoreResults) return SQL_ERROR;
|
|
|
|
return pSQLMoreResults(hstmt);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNativeSql [ODBC32.062]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLNativeSql(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHDBC hdbc,
|
|
|
|
SQLCHAR *szSqlStrIn,
|
|
|
|
SQLINTEGER cbSqlStrIn,
|
|
|
|
SQLCHAR *szSqlStr,
|
|
|
|
SQLINTEGER cbSqlStrMax,
|
|
|
|
SQLINTEGER *pcbSqlStr)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLNativeSql) return SQL_ERROR;
|
|
|
|
return pSQLNativeSql(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNumParams [ODBC32.063]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLNumParams(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLSMALLINT *pcpar)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLNumParams) return SQL_ERROR;
|
|
|
|
return pSQLNumParams(hstmt, pcpar);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLParamOptions [ODBC32.064]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLParamOptions(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLUINTEGER crow,
|
|
|
|
SQLUINTEGER *pirow)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLParamOptions) return SQL_ERROR;
|
|
|
|
return pSQLParamOptions(hstmt, crow, pirow);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrimaryKeys [ODBC32.065]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLPrimaryKeys(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLCHAR *szCatalogName,
|
|
|
|
SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName,
|
|
|
|
SQLSMALLINT cbSchemaName,
|
|
|
|
SQLCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLPrimaryKeys) return SQL_ERROR;
|
|
|
|
return pSQLPrimaryKeys(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szTableName, cbTableName);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProcedureColumns [ODBC32.066]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLProcedureColumns(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLCHAR *szCatalogName,
|
|
|
|
SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName,
|
|
|
|
SQLSMALLINT cbSchemaName,
|
|
|
|
SQLCHAR *szProcName,
|
|
|
|
SQLSMALLINT cbProcName,
|
|
|
|
SQLCHAR *szColumnName,
|
|
|
|
SQLSMALLINT cbColumnName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLProcedureColumns) return SQL_ERROR;
|
|
|
|
return pSQLProcedureColumns(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szProcName, cbProcName, szColumnName, cbColumnName);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProcedures [ODBC32.067]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLProcedures(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLCHAR *szCatalogName,
|
|
|
|
SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName,
|
|
|
|
SQLSMALLINT cbSchemaName,
|
|
|
|
SQLCHAR *szProcName,
|
|
|
|
SQLSMALLINT cbProcName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLProcedures) return SQL_ERROR;
|
|
|
|
return pSQLProcedures(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szProcName, cbProcName);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetPos [ODBC32.068]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetPos(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLUSMALLINT irow,
|
|
|
|
SQLUSMALLINT fOption,
|
|
|
|
SQLUSMALLINT fLock)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetPos) return SQL_ERROR;
|
|
|
|
return pSQLSetPos(hstmt, irow, fOption, fLock);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTablePrivileges [ODBC32.070]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLTablePrivileges(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLCHAR *szCatalogName,
|
|
|
|
SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName,
|
|
|
|
SQLSMALLINT cbSchemaName,
|
|
|
|
SQLCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLTablePrivileges) return SQL_ERROR;
|
|
|
|
return pSQLTablePrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szTableName, cbTableName);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDrivers [ODBC32.071]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLDrivers(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHENV henv,
|
|
|
|
SQLUSMALLINT fDirection,
|
|
|
|
SQLCHAR *szDriverDesc,
|
|
|
|
SQLSMALLINT cbDriverDescMax,
|
|
|
|
SQLSMALLINT *pcbDriverDesc,
|
|
|
|
SQLCHAR *szDriverAttributes,
|
|
|
|
SQLSMALLINT cbDriverAttrMax,
|
|
|
|
SQLSMALLINT *pcbDriverAttr)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDrivers) return SQL_ERROR;
|
|
|
|
return pSQLDrivers(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc,
|
|
|
|
szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBindParameter [ODBC32.072]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLBindParameter(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLUSMALLINT ipar,
|
|
|
|
SQLSMALLINT fParamType,
|
|
|
|
SQLSMALLINT fCType,
|
|
|
|
SQLSMALLINT fSqlType,
|
|
|
|
SQLUINTEGER cbColDef,
|
|
|
|
SQLSMALLINT ibScale,
|
|
|
|
SQLPOINTER rgbValue,
|
|
|
|
SQLINTEGER cbValueMax,
|
|
|
|
SQLINTEGER *pcbValue)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLBindParameter) return SQL_ERROR;
|
|
|
|
return pSQLBindParameter(hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale,
|
|
|
|
rgbValue, cbValueMax, pcbValue);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDriverConnect [ODBC32.041]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLDriverConnect(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHDBC hdbc,
|
|
|
|
SQLHWND hwnd,
|
|
|
|
SQLCHAR *conn_str_in,
|
|
|
|
SQLSMALLINT len_conn_str_in,
|
|
|
|
SQLCHAR *conn_str_out,
|
|
|
|
SQLSMALLINT conn_str_out_max,
|
|
|
|
SQLSMALLINT *ptr_conn_str_out,
|
|
|
|
SQLUSMALLINT driver_completion )
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDriverConnect) return SQL_ERROR;
|
|
|
|
return pSQLDriverConnect(hdbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out,
|
|
|
|
conn_str_out_max, ptr_conn_str_out, driver_completion);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetScrollOptions [ODBC32.069]
|
|
|
|
*/
|
2000-06-07 04:15:39 +02:00
|
|
|
SQLRETURN WINAPI SQLSetScrollOptions(
|
1999-12-12 00:56:46 +01:00
|
|
|
SQLHSTMT statement_handle,
|
|
|
|
SQLUSMALLINT f_concurrency,
|
|
|
|
SQLINTEGER crow_keyset,
|
|
|
|
SQLUSMALLINT crow_rowset )
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetScrollOptions) return SQL_ERROR;
|
|
|
|
return pSQLSetScrollOptions(statement_handle, f_concurrency, crow_keyset, crow_rowset);
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
2005-01-25 20:04:03 +01:00
|
|
|
static int SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType)
|
|
|
|
{
|
2007-02-21 15:45:21 +01:00
|
|
|
static const SQLUSMALLINT attrList[] =
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
|
|
|
SQL_COLUMN_OWNER_NAME,
|
|
|
|
SQL_COLUMN_QUALIFIER_NAME,
|
|
|
|
SQL_COLUMN_LABEL,
|
|
|
|
SQL_COLUMN_NAME,
|
|
|
|
SQL_COLUMN_TABLE_NAME,
|
|
|
|
SQL_COLUMN_TYPE_NAME,
|
|
|
|
SQL_DESC_BASE_COLUMN_NAME,
|
|
|
|
SQL_DESC_BASE_TABLE_NAME,
|
|
|
|
SQL_DESC_CATALOG_NAME,
|
|
|
|
SQL_DESC_LABEL,
|
|
|
|
SQL_DESC_LITERAL_PREFIX,
|
|
|
|
SQL_DESC_LITERAL_SUFFIX,
|
|
|
|
SQL_DESC_LOCAL_TYPE_NAME,
|
|
|
|
SQL_DESC_NAME,
|
|
|
|
SQL_DESC_SCHEMA_NAME,
|
|
|
|
SQL_DESC_TABLE_NAME,
|
|
|
|
SQL_DESC_TYPE_NAME,
|
|
|
|
};
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(attrList) / sizeof(SQLUSMALLINT); i++) {
|
|
|
|
if (attrList[i] == fDescType) return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttributesW [ODBC32.106]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLColAttributesW(
|
|
|
|
SQLHSTMT hstmt,
|
|
|
|
SQLUSMALLINT icol,
|
|
|
|
SQLUSMALLINT fDescType,
|
|
|
|
SQLPOINTER rgbDesc,
|
|
|
|
SQLSMALLINT cbDescMax,
|
|
|
|
SQLSMALLINT *pcbDesc,
|
|
|
|
SQLINTEGER *pfDesc)
|
|
|
|
{
|
|
|
|
SQLRETURN iResult;
|
|
|
|
|
|
|
|
TRACE("hstmt=0x%08lx icol=%d fDescType=%d rgbDesc=%p cbDescMax=%d pcbDesc=%p pfDesc=%p\n",
|
|
|
|
hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColAttributesW) return SQL_ERROR;
|
|
|
|
|
|
|
|
iResult = pSQLColAttributesW(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
|
2005-01-25 20:04:03 +01:00
|
|
|
if (iResult == SQL_SUCCESS && rgbDesc != NULL && SQLColAttributes_KnownStringAttribute(fDescType)) {
|
|
|
|
/*
|
|
|
|
TRACE("Dumping values fetched via SQLColAttributesW:\n");
|
|
|
|
TRACE(" Attribute name : %s\n", debugstr_w(rgbDesc));
|
|
|
|
TRACE(" Declared length: %d\n", *pcbDesc);
|
|
|
|
*/
|
2008-10-25 17:43:47 +02:00
|
|
|
if (*pcbDesc != lstrlenW(rgbDesc) * 2) {
|
2005-01-25 20:04:03 +01:00
|
|
|
TRACE("CHEAT: resetting name length for ADO\n");
|
2008-10-25 17:43:47 +02:00
|
|
|
*pcbDesc = lstrlenW(rgbDesc) * 2;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return iResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLConnectW [ODBC32.107]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle,
|
|
|
|
WCHAR *ServerName, SQLSMALLINT NameLength1,
|
|
|
|
WCHAR *UserName, SQLSMALLINT NameLength2,
|
|
|
|
WCHAR *Authentication, SQLSMALLINT NameLength3)
|
|
|
|
{
|
|
|
|
SQLRETURN ret;
|
|
|
|
TRACE("(Server=%.*s)\n",NameLength1+3, debugstr_w(ServerName));
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLConnectW) return SQL_ERROR;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLConnectW(ConnectionHandle, ServerName, NameLength1,
|
|
|
|
UserName, NameLength2, Authentication, NameLength3);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
|
|
|
TRACE("returns %d\n",ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDescribeColW [ODBC32.108]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle,
|
|
|
|
SQLUSMALLINT ColumnNumber, WCHAR *ColumnName,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
|
|
|
|
SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
|
|
|
|
SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
|
|
|
|
{
|
|
|
|
SQLRETURN iResult;
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDescribeColW) return SQL_ERROR;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
iResult = pSQLDescribeColW(StatementHandle, ColumnNumber, ColumnName,
|
|
|
|
BufferLength, NameLength, DataType, ColumnSize,
|
|
|
|
DecimalDigits, Nullable);
|
2005-01-25 20:04:03 +01:00
|
|
|
if (iResult >= 0) {
|
|
|
|
TRACE("Successfully recovered the following column information:\n");
|
|
|
|
TRACE("\tRequested column index: %d\n", ColumnNumber);
|
|
|
|
TRACE("\tAvailable length for column name: %d\n", BufferLength);
|
|
|
|
if (NameLength != NULL)
|
|
|
|
TRACE("\tActual length for column name: %d\n", *NameLength);
|
|
|
|
else TRACE("\tActual length for column name: (null)\n");
|
|
|
|
TRACE("\tReturned column name: %s\n", debugstr_w(ColumnName));
|
|
|
|
}
|
|
|
|
return iResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLErrorW [ODBC32.110]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle,
|
|
|
|
SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
|
|
|
|
WCHAR *Sqlstate, SQLINTEGER *NativeError,
|
|
|
|
WCHAR *MessageText, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *TextLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLErrorW) return SQL_ERROR;
|
|
|
|
return pSQLErrorW(EnvironmentHandle, ConnectionHandle, StatementHandle,
|
|
|
|
Sqlstate, NativeError, MessageText, BufferLength, TextLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExecDirectW [ODBC32.111]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle,
|
|
|
|
WCHAR *StatementText, SQLINTEGER TextLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLExecDirectW) return SQL_ERROR;
|
|
|
|
return pSQLExecDirectW(StatementHandle, StatementText, TextLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetCursorNameW [ODBC32.117]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle,
|
|
|
|
WCHAR *CursorName, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *NameLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetCursorNameW) return SQL_ERROR;
|
|
|
|
return pSQLGetCursorNameW(StatementHandle, CursorName, BufferLength, NameLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrepareW [ODBC32.119]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle,
|
|
|
|
WCHAR *StatementText, SQLINTEGER TextLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLPrepareW) return SQL_ERROR;
|
|
|
|
return pSQLPrepareW(StatementHandle, StatementText, TextLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetCursorNameW [ODBC32.121]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetCursorNameW) return SQL_ERROR;
|
|
|
|
return pSQLSetCursorNameW(StatementHandle, CursorName, NameLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttributeW [ODBC32.127]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLColAttributeW (SQLHSTMT StatementHandle,
|
|
|
|
SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute)
|
|
|
|
{
|
|
|
|
SQLRETURN iResult;
|
|
|
|
|
|
|
|
TRACE("StatementHandle=0x%08lx ColumnNumber=%d FieldIdentifier=%d CharacterAttribute=%p BufferLength=%d StringLength=%p NumericAttribute=%p\n",
|
|
|
|
StatementHandle, ColumnNumber, FieldIdentifier,
|
|
|
|
CharacterAttribute, BufferLength, StringLength, NumericAttribute);
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColAttributeW) return SQL_ERROR;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
iResult = pSQLColAttributeW(StatementHandle, ColumnNumber, FieldIdentifier,
|
|
|
|
CharacterAttribute, BufferLength, StringLength, NumericAttribute);
|
2005-01-25 20:04:03 +01:00
|
|
|
if (iResult == SQL_SUCCESS && CharacterAttribute != NULL && SQLColAttributes_KnownStringAttribute(FieldIdentifier)) {
|
|
|
|
/*
|
|
|
|
TRACE("Dumping values fetched via SQLColAttributeW:\n");
|
|
|
|
TRACE(" Attribute name : %s\n", debugstr_w(rgbDesc));
|
|
|
|
TRACE(" Declared length: %d\n", *pcbDesc);
|
|
|
|
*/
|
2008-10-25 17:43:47 +02:00
|
|
|
if (*StringLength != lstrlenW(CharacterAttribute) * 2) {
|
2005-01-25 20:04:03 +01:00
|
|
|
TRACE("CHEAT: resetting name length for ADO\n");
|
2008-10-25 17:43:47 +02:00
|
|
|
*StringLength = lstrlenW(CharacterAttribute) * 2;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return iResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectAttrW [ODBC32.132]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle,
|
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetConnectAttrW) return SQL_ERROR;
|
|
|
|
return pSQLGetConnectAttrW(ConnectionHandle, Attribute, Value,
|
|
|
|
BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescFieldW [ODBC32.133]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle,
|
|
|
|
SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength,
|
|
|
|
SQLINTEGER *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDescFieldW) return SQL_ERROR;
|
|
|
|
return pSQLGetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier,
|
|
|
|
Value, BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescRecW [ODBC32.134]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle,
|
|
|
|
SQLSMALLINT RecNumber, WCHAR *Name,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
|
|
|
|
SQLSMALLINT *Type, SQLSMALLINT *SubType,
|
|
|
|
SQLINTEGER *Length, SQLSMALLINT *Precision,
|
|
|
|
SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDescRecW) return SQL_ERROR;
|
|
|
|
return pSQLGetDescRecW(DescriptorHandle, RecNumber, Name, BufferLength,
|
|
|
|
StringLength, Type, SubType, Length, Precision, Scale, Nullable);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagFieldW [ODBC32.135]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle,
|
|
|
|
SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
|
|
|
|
SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDiagFieldW) return SQL_ERROR;
|
|
|
|
return pSQLGetDiagFieldW(HandleType, Handle, RecNumber, DiagIdentifier,
|
|
|
|
DiagInfo, BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagRecW [ODBC32.136]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle,
|
|
|
|
SQLSMALLINT RecNumber, WCHAR *Sqlstate,
|
|
|
|
SQLINTEGER *NativeError, WCHAR *MessageText,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetDiagRecW) return SQL_ERROR;
|
|
|
|
return pSQLGetDiagRecW(HandleType, Handle, RecNumber, Sqlstate, NativeError,
|
|
|
|
MessageText, BufferLength, TextLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetStmtAttrW [ODBC32.138]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle,
|
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
|
|
|
{
|
|
|
|
SQLRETURN iResult;
|
|
|
|
|
|
|
|
TRACE("Attribute = (%02ld) Value = %p BufferLength = (%ld) StringLength = %p\n",
|
|
|
|
Attribute, Value, BufferLength, StringLength);
|
|
|
|
|
|
|
|
if (Value == NULL) {
|
|
|
|
WARN("Unexpected NULL in Value return address\n");
|
|
|
|
iResult = SQL_ERROR;
|
|
|
|
/*
|
|
|
|
} else if (StringLength == NULL) {
|
|
|
|
WARN("Unexpected NULL in StringLength return address\n");
|
|
|
|
iResult = SQL_ERROR;
|
|
|
|
*/
|
|
|
|
} else {
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetStmtAttrW) return SQL_ERROR;
|
|
|
|
iResult = pSQLGetStmtAttrW(StatementHandle, Attribute, Value, BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
TRACE("returning %d...\n", iResult);
|
|
|
|
}
|
|
|
|
return iResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectAttrW [ODBC32.139]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute,
|
|
|
|
SQLPOINTER Value, SQLINTEGER StringLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetConnectAttrW) return SQL_ERROR;
|
|
|
|
return pSQLSetConnectAttrW(ConnectionHandle, Attribute, Value, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumnsW [ODBC32.140]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle,
|
|
|
|
WCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
WCHAR *SchemaName, SQLSMALLINT NameLength2,
|
|
|
|
WCHAR *TableName, SQLSMALLINT NameLength3,
|
|
|
|
WCHAR *ColumnName, SQLSMALLINT NameLength4)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColumnsW) return SQL_ERROR;
|
|
|
|
return pSQLColumnsW(StatementHandle, CatalogName, NameLength1,
|
|
|
|
SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDriverConnectW [ODBC32.141]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLDriverConnectW(
|
|
|
|
SQLHDBC hdbc,
|
|
|
|
SQLHWND hwnd,
|
|
|
|
WCHAR *conn_str_in,
|
|
|
|
SQLSMALLINT len_conn_str_in,
|
|
|
|
WCHAR *conn_str_out,
|
|
|
|
SQLSMALLINT conn_str_out_max,
|
|
|
|
SQLSMALLINT *ptr_conn_str_out,
|
|
|
|
SQLUSMALLINT driver_completion )
|
|
|
|
{
|
|
|
|
TRACE("ConnStrIn (%d bytes) --> %s\n", len_conn_str_in, debugstr_w(conn_str_in));
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDriverConnectW) return SQL_ERROR;
|
|
|
|
return pSQLDriverConnectW(hdbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out,
|
|
|
|
conn_str_out_max, ptr_conn_str_out, driver_completion);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectOptionW [ODBC32.142]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetConnectOptionW) return SQL_ERROR;
|
|
|
|
return pSQLGetConnectOptionW(ConnectionHandle, Option, Value);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetInfoW [ODBC32.145]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle,
|
|
|
|
SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
|
|
|
|
{
|
|
|
|
SQLRETURN iResult;
|
|
|
|
|
|
|
|
TRACE("InfoType = (%02u), InfoValue = %p, BufferLength = %d bytes\n", InfoType, InfoValue, BufferLength);
|
|
|
|
if (InfoValue == NULL) {
|
|
|
|
WARN("Unexpected NULL in InfoValue address\n");
|
|
|
|
iResult = SQL_ERROR;
|
|
|
|
} else {
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetInfoW) return SQL_ERROR;
|
|
|
|
iResult = pSQLGetInfoW(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
TRACE("returning %d...\n", iResult);
|
|
|
|
}
|
|
|
|
return iResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetTypeInfoW [ODBC32.147]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLGetTypeInfoW) return SQL_ERROR;
|
|
|
|
return pSQLGetTypeInfoW(StatementHandle, DataType);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectOptionW [ODBC32.150]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLUINTEGER Value)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetConnectOptionW) return SQL_ERROR;
|
|
|
|
return pSQLSetConnectOptionW(ConnectionHandle, Option, Value);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSpecialColumnsW [ODBC32.152]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLUSMALLINT IdentifierType, SQLWCHAR *CatalogName,
|
|
|
|
SQLSMALLINT NameLength1, SQLWCHAR *SchemaName,
|
|
|
|
SQLSMALLINT NameLength2, SQLWCHAR *TableName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
|
|
|
|
SQLUSMALLINT Nullable)
|
|
|
|
{
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSpecialColumnsW) return SQL_ERROR;
|
|
|
|
return pSQLSpecialColumnsW(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName,
|
|
|
|
NameLength2, TableName, NameLength3, Scope, Nullable);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLStatisticsW [ODBC32.153]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLWCHAR *SchemaName, SQLSMALLINT NameLength2,
|
|
|
|
SQLWCHAR *TableName, SQLSMALLINT NameLength3,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLStatisticsW) return SQL_ERROR;
|
|
|
|
return pSQLStatisticsW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2,
|
|
|
|
TableName, NameLength3, Unique, Reserved);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTablesW [ODBC32.154]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLWCHAR *SchemaName, SQLSMALLINT NameLength2,
|
|
|
|
SQLWCHAR *TableName, SQLSMALLINT NameLength3,
|
|
|
|
SQLWCHAR *TableType, SQLSMALLINT NameLength4)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLTablesW) return SQL_ERROR;
|
|
|
|
return pSQLTablesW(StatementHandle, CatalogName, NameLength1,
|
|
|
|
SchemaName, NameLength2, TableName, NameLength3, TableType, NameLength4);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBrowseConnectW [ODBC32.155]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLBrowseConnectW(
|
|
|
|
SQLHDBC hdbc,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szConnStrIn,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbConnStrIn,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szConnStrOut,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbConnStrOutMax,
|
|
|
|
SQLSMALLINT *pcbConnStrOut)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLBrowseConnectW) return SQL_ERROR;
|
|
|
|
return pSQLBrowseConnectW(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut,
|
|
|
|
cbConnStrOutMax, pcbConnStrOut);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumnPrivilegesW [ODBC32.156]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLColumnPrivilegesW(
|
|
|
|
SQLHSTMT hstmt,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szCatalogName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbCatalogName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szSchemaName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbSchemaName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szTableName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbTableName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szColumnName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbColumnName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLColumnPrivilegesW) return SQL_ERROR;
|
|
|
|
return pSQLColumnPrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szTableName, cbTableName, szColumnName, cbColumnName);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDataSourcesW [ODBC32.157]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle,
|
|
|
|
SQLUSMALLINT Direction, WCHAR *ServerName,
|
|
|
|
SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
|
|
|
|
WCHAR *Description, SQLSMALLINT BufferLength2,
|
|
|
|
SQLSMALLINT *NameLength2)
|
|
|
|
{
|
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("EnvironmentHandle = %p\n", (LPVOID)EnvironmentHandle);
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDataSourcesW) return SQL_ERROR;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
ret = pSQLDataSourcesW(EnvironmentHandle, Direction, ServerName,
|
|
|
|
BufferLength1, NameLength1, Description, BufferLength2, NameLength2);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
|
|
|
if (TRACE_ON(odbc))
|
|
|
|
{
|
|
|
|
TRACE("returns: %d \t", ret);
|
|
|
|
if (*NameLength1 > 0)
|
|
|
|
TRACE("DataSource = %s,", debugstr_w(ServerName));
|
|
|
|
if (*NameLength2 > 0)
|
|
|
|
TRACE(" Description = %s", debugstr_w(Description));
|
|
|
|
TRACE("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLForeignKeysW [ODBC32.160]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLForeignKeysW(
|
|
|
|
SQLHSTMT hstmt,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szPkCatalogName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbPkCatalogName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szPkSchemaName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbPkSchemaName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szPkTableName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbPkTableName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szFkCatalogName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbFkCatalogName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szFkSchemaName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbFkSchemaName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szFkTableName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbFkTableName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLForeignKeysW) return SQL_ERROR;
|
|
|
|
return pSQLForeignKeysW(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName,
|
|
|
|
szPkTableName, cbPkTableName, szFkCatalogName, cbFkCatalogName,
|
|
|
|
szFkSchemaName, cbFkSchemaName, szFkTableName, cbFkTableName);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNativeSqlW [ODBC32.162]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLNativeSqlW(
|
|
|
|
SQLHDBC hdbc,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szSqlStrIn,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLINTEGER cbSqlStrIn,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szSqlStr,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLINTEGER cbSqlStrMax,
|
|
|
|
SQLINTEGER *pcbSqlStr)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLNativeSqlW) return SQL_ERROR;
|
|
|
|
return pSQLNativeSqlW(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrimaryKeysW [ODBC32.165]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLPrimaryKeysW(
|
|
|
|
SQLHSTMT hstmt,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szCatalogName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbCatalogName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szSchemaName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbSchemaName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szTableName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbTableName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLPrimaryKeysW) return SQL_ERROR;
|
|
|
|
return pSQLPrimaryKeysW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szTableName, cbTableName);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProcedureColumnsW [ODBC32.166]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLProcedureColumnsW(
|
|
|
|
SQLHSTMT hstmt,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szCatalogName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbCatalogName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szSchemaName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbSchemaName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szProcName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbProcName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szColumnName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbColumnName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLProcedureColumnsW) return SQL_ERROR;
|
|
|
|
return pSQLProcedureColumnsW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szProcName, cbProcName, szColumnName, cbColumnName);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProceduresW [ODBC32.167]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLProceduresW(
|
|
|
|
SQLHSTMT hstmt,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szCatalogName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbCatalogName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szSchemaName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbSchemaName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szProcName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbProcName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLProceduresW) return SQL_ERROR;
|
|
|
|
return pSQLProceduresW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szProcName, cbProcName);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTablePrivilegesW [ODBC32.170]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLTablePrivilegesW(
|
|
|
|
SQLHSTMT hstmt,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szCatalogName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbCatalogName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szSchemaName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbSchemaName,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szTableName,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbTableName)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLTablePrivilegesW) return SQL_ERROR;
|
|
|
|
return pSQLTablePrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
|
|
|
|
szTableName, cbTableName);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDriversW [ODBC32.171]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLDriversW(
|
|
|
|
SQLHENV henv,
|
|
|
|
SQLUSMALLINT fDirection,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szDriverDesc,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbDriverDescMax,
|
|
|
|
SQLSMALLINT *pcbDriverDesc,
|
2009-10-03 14:40:19 +02:00
|
|
|
SQLWCHAR *szDriverAttributes,
|
2005-01-25 20:04:03 +01:00
|
|
|
SQLSMALLINT cbDriverAttrMax,
|
|
|
|
SQLSMALLINT *pcbDriverAttr)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLDriversW) return SQL_ERROR;
|
|
|
|
return pSQLDriversW(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc,
|
|
|
|
szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetDescFieldW [ODBC32.173]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle,
|
|
|
|
SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength)
|
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetDescFieldW) return SQL_ERROR;
|
|
|
|
return pSQLSetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetStmtAttrW [ODBC32.176]
|
|
|
|
*/
|
|
|
|
SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle,
|
|
|
|
SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
|
|
|
{
|
|
|
|
SQLRETURN iResult;
|
|
|
|
TRACE("Attribute = (%02ld) Value = %p StringLength = (%ld)\n",
|
|
|
|
Attribute, Value, StringLength);
|
|
|
|
|
2009-10-03 14:40:19 +02:00
|
|
|
if (!pSQLSetStmtAttrW) return SQL_ERROR;
|
|
|
|
iResult = pSQLSetStmtAttrW(StatementHandle, Attribute, Value, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
if (iResult == SQL_ERROR && (Attribute == SQL_ROWSET_SIZE || Attribute == SQL_ATTR_ROW_ARRAY_SIZE)) {
|
|
|
|
TRACE("CHEAT: returning SQL_SUCCESS to ADO...\n");
|
|
|
|
iResult = SQL_SUCCESS;
|
|
|
|
} else {
|
|
|
|
TRACE("returning %d...\n", iResult);
|
|
|
|
}
|
|
|
|
return iResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-02 22:28:06 +02:00
|
|
|
/* End of file */
|