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
|
|
|
*/
|
|
|
|
|
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"
|
2020-10-01 12:14:20 +02:00
|
|
|
#include "winternl.h"
|
2004-10-19 00:47:14 +02:00
|
|
|
#include "winreg.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
#include "sql.h"
|
|
|
|
#include "sqltypes.h"
|
|
|
|
#include "sqlext.h"
|
2020-10-01 12:14:20 +02:00
|
|
|
#include "unixlib.h"
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2020-10-01 12:14:20 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(odbc);
|
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
static unixlib_handle_t odbc_handle;
|
2020-10-01 12:14:20 +02:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
#define ODBC_CALL( func, params ) __wine_unix_call( odbc_handle, unix_ ## func, params )
|
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;
|
2013-11-16 11:00:08 +01:00
|
|
|
BOOL success;
|
2004-10-19 00:47:14 +02:00
|
|
|
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
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;
|
|
|
|
|
2013-11-16 11:00:08 +01:00
|
|
|
success = TRUE;
|
2004-10-19 00:47:14 +02:00
|
|
|
dirn = SQL_FETCH_FIRST;
|
2020-10-01 12:11:29 +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);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
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);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WARN ("Unusually long driver name %s not replicated\n",
|
|
|
|
desc);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sql_ret != SQL_NO_DATA)
|
|
|
|
{
|
|
|
|
TRACE ("Error %d enumerating drivers\n", (int)sql_ret);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
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)
|
|
|
|
*/
|
2014-01-14 23:32:55 +01:00
|
|
|
static void ODBC_ReplicateODBCToRegistry (BOOL is_user, SQLHENV hEnv)
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
|
|
|
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;
|
2013-11-16 11:00:08 +01:00
|
|
|
BOOL success;
|
2004-10-19 00:47:14 +02:00
|
|
|
const char *which = is_user ? "user" : "system";
|
|
|
|
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
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)
|
|
|
|
{
|
2013-11-16 11:00:08 +01:00
|
|
|
success = TRUE;
|
2004-10-19 00:47:14 +02:00
|
|
|
dirn = is_user ? SQL_FETCH_FIRST_USER : SQL_FETCH_FIRST_SYSTEM;
|
2020-10-01 12:11:29 +02:00
|
|
|
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);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
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);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WARN ("Unusually long %s data source name %s (%s) not "
|
|
|
|
"replicated\n", which, dsn, desc);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sql_ret != SQL_NO_DATA)
|
|
|
|
{
|
|
|
|
TRACE ("Error %d enumerating %s datasources\n",
|
|
|
|
(int)sql_ret, which);
|
2013-11-16 11:00:08 +01:00
|
|
|
success = FALSE;
|
2004-10-19 00:47:14 +02:00
|
|
|
}
|
|
|
|
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;
|
|
|
|
|
2020-10-01 12:11:29 +02:00
|
|
|
if ((sql_ret = SQLAllocEnv(&hEnv)) == SQL_SUCCESS)
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
|
|
|
ODBC_ReplicateODBCInstToRegistry (hEnv);
|
2014-01-14 23:32:55 +01:00
|
|
|
ODBC_ReplicateODBCToRegistry (FALSE /* system dsns */, hEnv);
|
|
|
|
ODBC_ReplicateODBCToRegistry (TRUE /* user dsns */, hEnv);
|
2004-10-19 00:47:14 +02:00
|
|
|
|
2020-10-01 12:11:29 +02:00
|
|
|
if ((sql_ret = SQLFreeEnv(hEnv)) != SQL_SUCCESS)
|
2004-10-19 00:47:14 +02:00
|
|
|
{
|
|
|
|
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
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocConnect [ODBC32.001]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLAllocConnect_params params = { EnvironmentHandle, ConnectionHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
*ConnectionHandle = SQL_NULL_HDBC;
|
|
|
|
ret = ODBC_CALL( SQLAllocConnect, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d, ConnectionHandle %p\n", ret, *ConnectionHandle);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocEnv [ODBC32.002]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLAllocEnv_params params = { EnvironmentHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
*EnvironmentHandle = SQL_NULL_HENV;
|
|
|
|
ret = ODBC_CALL( SQLAllocEnv, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d, EnvironmentHandle %p\n", ret, *EnvironmentHandle);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocHandle [ODBC32.024]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLAllocHandle_params params = { HandleType, InputHandle, OutputHandle };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
*OutputHandle = 0;
|
|
|
|
ret = ODBC_CALL( SQLAllocHandle, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d, Handle %p\n", ret, *OutputHandle);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocStmt [ODBC32.003]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLAllocStmt_params params = { ConnectionHandle, StatementHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
*StatementHandle = SQL_NULL_HSTMT;
|
|
|
|
ret = ODBC_CALL( SQLAllocStmt, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE ("Returning %d, StatementHandle %p\n", ret, *StatementHandle);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLAllocHandleStd [ODBC32.077]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLAllocHandleStd(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLAllocHandleStd_params params = { HandleType, InputHandle, OutputHandle };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
*OutputHandle = 0;
|
|
|
|
ret = ODBC_CALL( SQLAllocHandleStd, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE ("Returning %d, OutputHandle %p\n", ret, *OutputHandle);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
static const char *debugstr_sqllen( SQLLEN len )
|
|
|
|
{
|
|
|
|
#ifdef _WIN64
|
|
|
|
return wine_dbg_sprintf( "%ld", len );
|
|
|
|
#else
|
|
|
|
return wine_dbg_sprintf( "%d", len );
|
|
|
|
#endif
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBindCol [ODBC32.004]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
|
|
|
|
SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLBindCol_params params = { StatementHandle, ColumnNumber, TargetType, TargetValue,
|
|
|
|
BufferLength, StrLen_or_Ind };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n",
|
|
|
|
StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLBindCol, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE ("Returning %d\n", ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
static const char *debugstr_sqlulen( SQLULEN len )
|
|
|
|
{
|
|
|
|
#ifdef _WIN64
|
|
|
|
return wine_dbg_sprintf( "%lu", len );
|
|
|
|
#else
|
|
|
|
return wine_dbg_sprintf( "%u", len );
|
|
|
|
#endif
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBindParam [ODBC32.025]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
|
|
|
|
SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale,
|
|
|
|
SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLBindParam_params params = { StatementHandle, ParameterNumber, ValueType, ParameterType,
|
|
|
|
LengthPrecision, ParameterScale, ParameterValue, StrLen_or_Ind };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s,"
|
|
|
|
" ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType,
|
|
|
|
ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLBindParam, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE ("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLCancel [ODBC32.005]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLCancel_params params = { StatementHandle };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p)\n", StatementHandle);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLCancel, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLCloseCursor [ODBC32.026]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLCloseCursor_params params = { StatementHandle };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p)\n", StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLCloseCursor, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttribute [ODBC32.027]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber,
|
|
|
|
SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
|
|
|
|
SQLLEN *NumericAttribute)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColAttribute_params params = { StatementHandle, ColumnNumber, FieldIdentifier,
|
|
|
|
CharacterAttribute, BufferLength, StringLength, NumericAttribute };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d,"
|
|
|
|
" StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier,
|
|
|
|
CharacterAttribute, BufferLength, StringLength, NumericAttribute);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColAttribute, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumns [ODBC32.040]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName,
|
|
|
|
SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColumns_params params = { StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2,
|
|
|
|
TableName, NameLength3, ColumnName, NameLength4 };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
|
|
|
|
" NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle,
|
|
|
|
debugstr_an((const char *)CatalogName, NameLength1), NameLength1,
|
|
|
|
debugstr_an((const char *)SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_an((const char *)TableName, NameLength3), NameLength3,
|
|
|
|
debugstr_an((const char *)ColumnName, NameLength4), NameLength4);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColumns, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLConnect [ODBC32.007]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication,
|
|
|
|
SQLSMALLINT NameLength3)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLConnect_params params = { ConnectionHandle, ServerName, NameLength1, UserName, NameLength2,
|
|
|
|
Authentication, NameLength3 };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-07 22:37:05 +01:00
|
|
|
TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s,"
|
2019-02-05 21:22:57 +01:00
|
|
|
" NameLength3 %d)\n", ConnectionHandle,
|
|
|
|
debugstr_an((const char *)ServerName, NameLength1), NameLength1,
|
|
|
|
debugstr_an((const char *)UserName, NameLength2), NameLength2,
|
|
|
|
debugstr_an((const char *)Authentication, NameLength3), NameLength3);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLConnect, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLCopyDesc [ODBC32.028]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLCopyDesc_params params = { SourceDescHandle, TargetDescHandle };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLCopyDesc, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDataSources [ODBC32.057]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName,
|
|
|
|
SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description,
|
|
|
|
SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDataSources_params params = { EnvironmentHandle, Direction, ServerName, BufferLength1,
|
|
|
|
NameLength1, Description, BufferLength2, NameLength2 };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p,"
|
|
|
|
" BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1,
|
|
|
|
NameLength1, Description, BufferLength2, NameLength2);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDataSources, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
if (ret >= 0 && TRACE_ON(odbc))
|
|
|
|
{
|
|
|
|
if (ServerName && NameLength1 && *NameLength1 > 0)
|
|
|
|
TRACE(" DataSource %s", debugstr_an((const char *)ServerName, *NameLength1));
|
|
|
|
if (Description && NameLength2 && *NameLength2 > 0)
|
|
|
|
TRACE(" Description %s", debugstr_an((const char *)Description, *NameLength2));
|
|
|
|
TRACE("\n");
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName,
|
|
|
|
SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description,
|
|
|
|
SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2)
|
2012-11-20 04:56:50 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDataSourcesA_params params = { EnvironmentHandle, Direction, ServerName, BufferLength1,
|
|
|
|
NameLength1, Description, BufferLength2, NameLength2 };
|
2012-11-20 04:56:50 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p,"
|
|
|
|
" BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1,
|
|
|
|
NameLength1, Description, BufferLength2, NameLength2);
|
2012-11-20 04:56:50 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDataSourcesA, ¶ms );
|
2012-11-20 04:56:50 +01:00
|
|
|
if (TRACE_ON(odbc))
|
|
|
|
{
|
2019-02-05 21:22:57 +01:00
|
|
|
if (ServerName && NameLength1 && *NameLength1 > 0)
|
|
|
|
TRACE(" DataSource %s", debugstr_an((const char *)ServerName, *NameLength1));
|
|
|
|
if (Description && NameLength2 && *NameLength2 > 0)
|
|
|
|
TRACE(" Description %s", debugstr_an((const char *)Description, *NameLength2));
|
2012-11-20 04:56:50 +01:00
|
|
|
TRACE("\n");
|
|
|
|
}
|
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
2012-11-20 04:56:50 +01:00
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDescribeCol [ODBC32.008]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType,
|
|
|
|
SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDescribeCol_params params = { StatementHandle, ColumnNumber, ColumnName, BufferLength,
|
|
|
|
NameLength, DataType, ColumnSize, DecimalDigits, Nullable };
|
2019-02-05 21:22:56 +01:00
|
|
|
SQLSMALLINT dummy;
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p,"
|
|
|
|
" ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName,
|
|
|
|
BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
if (!params.NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */
|
2019-02-05 21:22:55 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDescribeCol, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
if (ret >= 0)
|
|
|
|
{
|
|
|
|
if (ColumnName && NameLength) TRACE(" ColumnName %s\n", debugstr_an((const char *)ColumnName, *NameLength));
|
|
|
|
if (DataType) TRACE(" DataType %d\n", *DataType);
|
|
|
|
if (ColumnSize) TRACE(" ColumnSize %s\n", debugstr_sqlulen(*ColumnSize));
|
|
|
|
if (DecimalDigits) TRACE(" DecimalDigits %d\n", *DecimalDigits);
|
|
|
|
if (Nullable) TRACE(" Nullable %d\n", *Nullable);
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDisconnect [ODBC32.009]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDisconnect_params params = { ConnectionHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(ConnectionHandle %p)\n", ConnectionHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDisconnect, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLEndTran [ODBC32.029]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLEndTran_params params = { HandleType, Handle, CompletionType };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLEndTran, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLError [ODBC32.010]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
|
|
|
|
SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLError_params params = { EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate,
|
|
|
|
NativeError, MessageText, BufferLength, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2017-01-13 14:24:48 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p,"
|
|
|
|
" MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle,
|
|
|
|
StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLError, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
|
|
|
|
if (ret == SQL_SUCCESS)
|
|
|
|
{
|
|
|
|
TRACE(" SQLState %s\n", debugstr_an((const char *)Sqlstate, 5));
|
|
|
|
TRACE(" Error %d\n", *NativeError);
|
|
|
|
TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength));
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExecDirect [ODBC32.011]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLExecDirect_params params = { StatementHandle, StatementText, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle,
|
|
|
|
debugstr_an((const char *)StatementText, TextLength), TextLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLExecDirect, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExecute [ODBC32.012]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLExecute_params params = { StatementHandle };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p)\n", StatementHandle);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLExecute, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFetch [ODBC32.013]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLFetch_params params = { StatementHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p)\n", StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLFetch, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFetchScroll [ODBC32.030]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLFetchScroll_params params = { StatementHandle, FetchOrientation, FetchOffset };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation,
|
|
|
|
debugstr_sqllen(FetchOffset));
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLFetchScroll, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeConnect [ODBC32.014]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLFreeConnect_params params = { ConnectionHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(ConnectionHandle %p)\n", ConnectionHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLFreeConnect, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeEnv [ODBC32.015]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLFreeEnv_params params = { EnvironmentHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLFreeEnv, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeHandle [ODBC32.031]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLFreeHandle_params params = { HandleType, Handle };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(HandleType %d, Handle %p)\n", HandleType, Handle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLFreeHandle, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE ("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLFreeStmt [ODBC32.016]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLFreeStmt_params params = { StatementHandle, Option };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLFreeStmt, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectAttr [ODBC32.032]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetConnectAttr_params params = { ConnectionHandle, Attribute, Value, BufferLength, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle,
|
|
|
|
Attribute, Value, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetConnectAttr, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectOption [ODBC32.042]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetConnectOption_params params = { ConnectionHandle, Option, Value };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetConnectOption, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetCursorName [ODBC32.017]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *NameLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetCursorName_params params = { StatementHandle, CursorName, BufferLength, NameLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName,
|
|
|
|
BufferLength, NameLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetCursorName, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetData [ODBC32.043]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
|
|
|
|
SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetData_params params = { StatementHandle, ColumnNumber, TargetType, TargetValue,
|
|
|
|
BufferLength, StrLen_or_Ind };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n",
|
|
|
|
StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetData, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescField [ODBC32.033]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDescField_params params = { DescriptorHandle, RecNumber, FieldIdentifier, Value,
|
|
|
|
BufferLength, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n",
|
|
|
|
DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDescField, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescRec [ODBC32.034]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR *Name,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type,
|
|
|
|
SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision,
|
|
|
|
SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDescRec_params params = { DescriptorHandle, RecNumber, Name, BufferLength, StringLength,
|
|
|
|
Type, SubType, Length, Precision, Scale, Nullable };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p,"
|
|
|
|
" Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength,
|
|
|
|
StringLength, Type, SubType, Length, Precision, Scale, Nullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDescRec, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagField [ODBC32.035]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
|
|
|
|
SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDiagField_params params = { HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo,
|
|
|
|
BufferLength, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d,"
|
|
|
|
" StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDiagField, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagRec [ODBC32.036]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
|
|
|
|
SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDiagRec_params params = { HandleType, Handle, RecNumber, Sqlstate, NativeError,
|
|
|
|
MessageText, BufferLength, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d,"
|
|
|
|
" TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength,
|
|
|
|
TextLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDiagRec, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetEnvAttr [ODBC32.037]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetEnvAttr_params params = { EnvironmentHandle, Attribute, Value, BufferLength, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n",
|
|
|
|
EnvironmentHandle, Attribute, Value, BufferLength, StringLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetEnvAttr, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetFunctions [ODBC32.044]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetFunctions_params params = { ConnectionHandle, FunctionId, Supported };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetFunctions, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetInfo [ODBC32.045]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetInfo_params params = { ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle,
|
|
|
|
InfoType, InfoValue, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
if (!InfoValue)
|
|
|
|
{
|
|
|
|
WARN("Unexpected NULL InfoValue address\n");
|
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetInfo, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
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
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetStmtAttr_params params = { StatementHandle, Attribute, Value, BufferLength, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle,
|
|
|
|
Attribute, Value, BufferLength, StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
if (!Value)
|
|
|
|
{
|
|
|
|
WARN("Unexpected NULL Value return address\n");
|
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetStmtAttr, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetStmtOption [ODBC32.046]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetStmtOption_params params = { StatementHandle, Option, Value };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle, Option, Value);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetStmtOption, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
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
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetTypeInfo_params params = { StatementHandle, DataType };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetTypeInfo, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNumResultCols [ODBC32.018]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLNumResultCols_params params = { StatementHandle, ColumnCount };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLNumResultCols, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d ColumnCount %d\n", ret, *ColumnCount);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLParamData [ODBC32.048]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLParamData_params params = { StatementHandle, Value };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, Value %p)\n", StatementHandle, Value);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLParamData, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrepare [ODBC32.019]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLPrepare_params params = { StatementHandle, StatementText, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle,
|
|
|
|
debugstr_an((const char *)StatementText, TextLength), TextLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLPrepare, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPutData [ODBC32.049]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLPutData_params params = { StatementHandle, Data, StrLen_or_Ind };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind));
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLPutData, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLRowCount [ODBC32.020]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLRowCount_params params = { StatementHandle, RowCount };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLRowCount, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
if (ret == SQL_SUCCESS && RowCount) TRACE(" RowCount %s\n", debugstr_sqllen(*RowCount));
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectAttr [ODBC32.039]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetConnectAttr_params params = { ConnectionHandle, Attribute, Value, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
|
|
|
|
StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetConnectAttr, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectOption [ODBC32.050]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetConnectOption_params params = { ConnectionHandle, Option, Value };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value));
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetConnectOption, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetCursorName [ODBC32.021]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetCursorName_params params = { StatementHandle, CursorName, NameLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle,
|
|
|
|
debugstr_an((const char *)CursorName, NameLength), NameLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetCursorName, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetDescField [ODBC32.073]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetDescField_params params = { DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle,
|
|
|
|
RecNumber, FieldIdentifier, Value, BufferLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetDescField, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetDescRec [ODBC32.074]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type,
|
|
|
|
SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale,
|
|
|
|
SQLPOINTER Data, SQLLEN *StringLength, SQLLEN *Indicator)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetDescRec_params params = { DescriptorHandle, RecNumber, Type, SubType, Length, Precision, Scale, Data, StringLength, Indicator };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p,"
|
|
|
|
" StringLength %p, Indicator %p)\n", DescriptorHandle, RecNumber, Type, SubType, debugstr_sqllen(Length),
|
|
|
|
Precision, Scale, Data, StringLength, Indicator);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetDescRec, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetEnvAttr [ODBC32.075]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetEnvAttr_params params = { EnvironmentHandle, Attribute, Value, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value,
|
|
|
|
StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetEnvAttr, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetParam [ODBC32.022]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
|
|
|
|
SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale,
|
|
|
|
SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetParam_params params = { StatementHandle, ParameterNumber, ValueType, ParameterType,
|
|
|
|
LengthPrecision, ParameterScale, ParameterValue, StrLen_or_Ind };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s,"
|
|
|
|
" ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType,
|
|
|
|
ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetParam, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetStmtAttr [ODBC32.076]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetStmtAttr_params params = { StatementHandle, Attribute, Value, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value,
|
|
|
|
StringLength);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetStmtAttr, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetStmtOption [ODBC32.051]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetStmtOption_params params = { StatementHandle, Option, Value };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle, Option, debugstr_sqlulen(Value));
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetStmtOption, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSpecialColumns [ODBC32.052]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
|
|
|
|
SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
|
|
|
|
SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
|
|
|
|
SQLUSMALLINT Nullable)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSpecialColumns_params params = { StatementHandle, IdentifierType, CatalogName, NameLength1,
|
|
|
|
SchemaName, NameLength2, TableName, NameLength3, Scope, Nullable };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d,"
|
|
|
|
" TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType,
|
|
|
|
debugstr_an((const char *)CatalogName, NameLength1), NameLength1,
|
|
|
|
debugstr_an((const char *)SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_an((const char *)TableName, NameLength3), NameLength3, Scope, Nullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSpecialColumns, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
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
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName,
|
|
|
|
SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLStatistics_params params = { StatementHandle, CatalogName, NameLength1, SchemaName,
|
|
|
|
NameLength2, TableName, NameLength3, Unique, Reserved };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s"
|
|
|
|
" NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle,
|
|
|
|
debugstr_an((const char *)CatalogName, NameLength1), NameLength1,
|
|
|
|
debugstr_an((const char *)SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_an((const char *)TableName, NameLength3), NameLength3, Unique, Reserved);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLStatistics, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTables [ODBC32.054]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName,
|
|
|
|
SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLTables_params params = { StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2,
|
|
|
|
TableName, NameLength3, TableType, NameLength4 };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
|
|
|
|
" NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle,
|
|
|
|
debugstr_an((const char *)CatalogName, NameLength1), NameLength1,
|
|
|
|
debugstr_an((const char *)SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_an((const char *)TableName, NameLength3), NameLength3,
|
|
|
|
debugstr_an((const char *)TableType, NameLength4), NameLength4);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLTables, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTransact [ODBC32.023]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLTransact_params params = { EnvironmentHandle, ConnectionHandle, CompletionType };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle,
|
|
|
|
CompletionType);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLTransact, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBrowseConnect [ODBC32.055]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn,
|
|
|
|
SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax,
|
|
|
|
SQLSMALLINT *pcbConnStrOut)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLBrowseConnect_params params = { hdbc, szConnStrIn, cbConnStrIn, szConnStrOut,
|
|
|
|
cbConnStrOutMax, pcbConnStrOut };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n",
|
|
|
|
hdbc, debugstr_an((const char *)szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax,
|
|
|
|
pcbConnStrOut);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLBrowseConnect, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBulkOperations [ODBC32.078]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLBulkOperations_params params = { StatementHandle, Operation };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLBulkOperations, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttributes [ODBC32.006]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType,
|
|
|
|
SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc,
|
|
|
|
SQLLEN *pfDesc)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColAttributes_params params = { hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol,
|
|
|
|
fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColAttributes, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumnPrivileges [ODBC32.056]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColumnPrivileges_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szTableName, cbTableName, szColumnName, cbColumnName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
|
|
|
|
" cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt,
|
|
|
|
debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_an((const char *)szTableName, cbTableName), cbTableName,
|
|
|
|
debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColumnPrivileges, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDescribeParam [ODBC32.058]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType,
|
|
|
|
SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDescribeParam_params params = { hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar,
|
|
|
|
pfSqlType, pcbParamDef, pibScale, pfNullable);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDescribeParam, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExtendedFetch [ODBC32.059]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow,
|
|
|
|
SQLUSMALLINT *rgfRowStatus)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLExtendedFetch_params params = { hstmt, fFetchType, irow, pcrow, rgfRowStatus };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow),
|
|
|
|
pcrow, rgfRowStatus);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLExtendedFetch, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLForeignKeys [ODBC32.060]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLForeignKeys(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)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLForeignKeys_params params = { hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName,
|
|
|
|
cbPkSchemaName, szPkTableName, cbPkTableName, szFkCatalogName,
|
|
|
|
cbFkCatalogName, szFkSchemaName, cbFkSchemaName,
|
|
|
|
szFkTableName, cbFkTableName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d,"
|
|
|
|
" szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s,"
|
|
|
|
" cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt,
|
|
|
|
debugstr_an((const char *)szPkCatalogName, cbPkCatalogName), cbPkCatalogName,
|
|
|
|
debugstr_an((const char *)szPkSchemaName, cbPkSchemaName), cbPkSchemaName,
|
|
|
|
debugstr_an((const char *)szPkTableName, cbPkTableName), cbPkTableName,
|
|
|
|
debugstr_an((const char *)szFkCatalogName, cbFkCatalogName), cbFkCatalogName,
|
|
|
|
debugstr_an((const char *)szFkSchemaName, cbFkSchemaName), cbFkSchemaName,
|
|
|
|
debugstr_an((const char *)szFkTableName, cbFkTableName), cbFkTableName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLForeignKeys, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLMoreResults [ODBC32.061]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLMoreResults_params params = { StatementHandle };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(%p)\n", StatementHandle);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLMoreResults, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNativeSql [ODBC32.062]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr,
|
|
|
|
SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLNativeSql_params params = { hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc,
|
|
|
|
debugstr_an((const char *)szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLNativeSql, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNumParams [ODBC32.063]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLNumParams_params params = { hstmt, pcpar };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, pcpar %p)\n", hstmt, pcpar);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLNumParams, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLParamOptions [ODBC32.064]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLParamOptions_params params = { hstmt, crow, pirow };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLParamOptions, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrimaryKeys [ODBC32.065]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLPrimaryKeys_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szTableName, cbTableName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
|
|
|
|
" cbTableName %d)\n", hstmt,
|
|
|
|
debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_an((const char *)szTableName, cbTableName), cbTableName);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLPrimaryKeys, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProcedureColumns [ODBC32.066]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName,
|
|
|
|
SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLProcedureColumns_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szProcName, cbProcName,
|
|
|
|
szColumnName, cbColumnName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
|
|
|
|
" cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt,
|
|
|
|
debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_an((const char *)szProcName, cbProcName), cbProcName,
|
|
|
|
debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLProcedureColumns, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProcedures [ODBC32.067]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName,
|
|
|
|
SQLSMALLINT cbProcName)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLProcedures_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szProcName, cbProcName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
|
|
|
|
" cbProcName %d)\n", hstmt,
|
|
|
|
debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_an((const char *)szProcName, cbProcName), cbProcName);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLProcedures, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetPos [ODBC32.068]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetPos_params params = { hstmt, irow, fOption, fLock };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetPos, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTablePrivileges [ODBC32.070]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLTablePrivileges_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szTableName, cbTableName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
|
|
|
|
" cbTableName %d)\n", hstmt,
|
|
|
|
debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_an((const char *)szTableName, cbTableName), cbTableName);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLTablePrivileges, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDrivers [ODBC32.071]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc,
|
|
|
|
SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc,
|
|
|
|
SQLCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax,
|
|
|
|
SQLSMALLINT *pcbDriverAttr)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDrivers_params params = { EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax,
|
|
|
|
pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2015-01-21 23:16:41 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p,"
|
|
|
|
" DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection,
|
|
|
|
szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDrivers, ¶ms );
|
2015-01-21 23:16:41 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST)
|
|
|
|
ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n");
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBindParameter [ODBC32.072]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType,
|
|
|
|
SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef,
|
|
|
|
SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax,
|
|
|
|
SQLLEN *pcbValue)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLBindParameter_params params = { hstmt, ipar, fParamType, fCType, fSqlType, cbColDef,
|
|
|
|
ibScale, rgbValue, cbValueMax, pcbValue };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p,"
|
|
|
|
" cbValueMax %s, pcbValue %p)\n", hstmt, ipar, fParamType, fCType, fSqlType, debugstr_sqlulen(cbColDef),
|
|
|
|
ibScale, rgbValue, debugstr_sqllen(cbValueMax), pcbValue);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLBindParameter, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDriverConnect [ODBC32.041]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *ConnectionString, SQLSMALLINT Length,
|
|
|
|
SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max,
|
|
|
|
SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDriverConnect_params params = { hdbc, hwnd, ConnectionString, Length, conn_str_out,
|
|
|
|
conn_str_out_max, ptr_conn_str_out, driver_completion };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2017-01-13 14:24:48 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d,"
|
|
|
|
" ptr_conn_str_out %p, driver_completion %d)\n", hdbc, hwnd,
|
|
|
|
debugstr_an((const char *)ConnectionString, Length), Length, conn_str_out, conn_str_out_max,
|
|
|
|
ptr_conn_str_out, driver_completion);
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDriverConnect, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
1999-12-12 00:56:46 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetScrollOptions [ODBC32.069]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset,
|
|
|
|
SQLUSMALLINT crow_rowset)
|
1999-12-12 00:56:46 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetScrollOptions_params params = { statement_handle, f_concurrency, crow_keyset, crow_rowset };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_handle,
|
|
|
|
f_concurrency, debugstr_sqllen(crow_keyset), crow_rowset);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetScrollOptions, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
1999-12-12 00:56:46 +01:00
|
|
|
}
|
|
|
|
|
2013-11-16 11:00:08 +01:00
|
|
|
static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
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;
|
|
|
|
|
2018-11-15 20:42:15 +01:00
|
|
|
for (i = 0; i < ARRAY_SIZE(attrList); i++) {
|
2013-11-16 11:00:08 +01:00
|
|
|
if (attrList[i] == fDescType) return TRUE;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
2013-11-16 11:00:08 +01:00
|
|
|
return FALSE;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttributesW [ODBC32.106]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType,
|
|
|
|
SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc,
|
|
|
|
SQLLEN *pfDesc)
|
2019-02-05 21:22:57 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColAttributesW_params params = { hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol,
|
|
|
|
fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColAttributesW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
|
|
|
|
if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(fDescType) && rgbDesc && pcbDesc &&
|
|
|
|
*pcbDesc != lstrlenW(rgbDesc) * 2)
|
|
|
|
{
|
|
|
|
TRACE("CHEAT: resetting name length for ADO\n");
|
|
|
|
*pcbDesc = lstrlenW(rgbDesc) * 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLConnectW [ODBC32.107]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMALLINT NameLength1,
|
|
|
|
WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication,
|
|
|
|
SQLSMALLINT NameLength3)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLConnectW_params params = { ConnectionHandle, ServerName, NameLength1, UserName, NameLength2,
|
|
|
|
Authentication, NameLength3 };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-07 22:37:05 +01:00
|
|
|
TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s,"
|
2019-02-05 21:22:57 +01:00
|
|
|
" NameLength3 %d)\n", ConnectionHandle, debugstr_wn(ServerName, NameLength1), NameLength1,
|
|
|
|
debugstr_wn(UserName, NameLength2), NameLength2, debugstr_wn(Authentication, NameLength3), NameLength3);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLConnectW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDescribeColW [ODBC32.108]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, WCHAR *ColumnName,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType,
|
|
|
|
SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDescribeColW_params params = { StatementHandle, ColumnNumber, ColumnName, BufferLength,
|
|
|
|
NameLength, DataType, ColumnSize, DecimalDigits, Nullable };
|
2019-02-05 21:22:56 +01:00
|
|
|
SQLSMALLINT dummy;
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p,"
|
|
|
|
" ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName,
|
|
|
|
BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:56 +01:00
|
|
|
if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */
|
2019-02-05 21:22:55 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDescribeColW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
if (ret >= 0)
|
|
|
|
{
|
|
|
|
if (ColumnName && NameLength) TRACE("ColumnName %s\n", debugstr_wn(ColumnName, *NameLength));
|
|
|
|
if (DataType) TRACE("DataType %d\n", *DataType);
|
|
|
|
if (ColumnSize) TRACE("ColumnSize %s\n", debugstr_sqlulen(*ColumnSize));
|
|
|
|
if (DecimalDigits) TRACE("DecimalDigits %d\n", *DecimalDigits);
|
|
|
|
if (Nullable) TRACE("Nullable %d\n", *Nullable);
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLErrorW [ODBC32.110]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
|
|
|
|
WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLErrorW_params params = { EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate,
|
|
|
|
NativeError, MessageText, BufferLength, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p,"
|
|
|
|
" MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle,
|
|
|
|
StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLErrorW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
|
|
|
|
if (ret == SQL_SUCCESS)
|
|
|
|
{
|
|
|
|
TRACE(" SQLState %s\n", debugstr_wn(Sqlstate, 5));
|
|
|
|
TRACE(" Error %d\n", *NativeError);
|
|
|
|
TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength));
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLExecDirectW [ODBC32.111]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLExecDirectW_params params = { StatementHandle, StatementText, TextLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle,
|
|
|
|
debugstr_wn(StatementText, TextLength), TextLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLExecDirectW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetCursorNameW [ODBC32.117]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *NameLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetCursorNameW_params params = { StatementHandle, CursorName, BufferLength, NameLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName,
|
|
|
|
BufferLength, NameLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetCursorNameW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrepareW [ODBC32.119]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLPrepareW_params params = { StatementHandle, StatementText, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle,
|
|
|
|
debugstr_wn(StatementText, TextLength), TextLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLPrepareW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetCursorNameW [ODBC32.121]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetCursorNameW_params params = { StatementHandle, CursorName, NameLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle,
|
|
|
|
debugstr_wn(CursorName, NameLength), NameLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetCursorNameW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColAttributeW [ODBC32.127]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber,
|
|
|
|
SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
|
|
|
|
SQLLEN *NumericAttribute)
|
2019-02-05 21:22:57 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColAttributeW_params params = { StatementHandle, ColumnNumber, FieldIdentifier,
|
|
|
|
CharacterAttribute, BufferLength, StringLength,
|
|
|
|
NumericAttribute };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d"
|
|
|
|
" StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier,
|
|
|
|
CharacterAttribute, BufferLength, StringLength, NumericAttribute);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColAttributeW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
|
|
|
|
if (ret == SQL_SUCCESS && CharacterAttribute != NULL && SQLColAttributes_KnownStringAttribute(FieldIdentifier) &&
|
|
|
|
StringLength && *StringLength != lstrlenW(CharacterAttribute) * 2)
|
|
|
|
{
|
|
|
|
TRACE("CHEAT: resetting name length for ADO\n");
|
|
|
|
*StringLength = lstrlenW(CharacterAttribute) * 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectAttrW [ODBC32.132]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetConnectAttrW_params params = { ConnectionHandle, Attribute, Value,
|
|
|
|
BufferLength, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle,
|
|
|
|
Attribute, Value, BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetConnectAttrW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescFieldW [ODBC32.133]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDescFieldW_params params = { DescriptorHandle, RecNumber, FieldIdentifier, Value,
|
|
|
|
BufferLength, StringLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n",
|
|
|
|
DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDescFieldW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDescRecW [ODBC32.134]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, WCHAR *Name,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type,
|
|
|
|
SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision,
|
|
|
|
SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDescRecW_params params = { DescriptorHandle, RecNumber, Name, BufferLength, StringLength,
|
|
|
|
Type, SubType, Length, Precision, Scale, Nullable };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p,"
|
|
|
|
" Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength,
|
|
|
|
StringLength, Type, SubType, Length, Precision, Scale, Nullable);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDescRecW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagFieldW [ODBC32.135]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
|
|
|
|
SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *StringLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDiagFieldW_params params = { HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo,
|
|
|
|
BufferLength, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d,"
|
|
|
|
" StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDiagFieldW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagRecW [ODBC32.136]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
|
|
|
|
WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDiagRecW_params params = { HandleType, Handle, RecNumber, Sqlstate, NativeError,
|
|
|
|
MessageText, BufferLength, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d,"
|
|
|
|
" TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength,
|
|
|
|
TextLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDiagRecW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetStmtAttrW [ODBC32.138]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetStmtAttrW_params params = { StatementHandle, Attribute, Value, BufferLength, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle,
|
|
|
|
Attribute, Value, BufferLength, StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
if (!Value)
|
|
|
|
{
|
|
|
|
WARN("Unexpected NULL Value return address\n");
|
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetStmtAttrW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectAttrW [ODBC32.139]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetConnectAttrW_params params = { ConnectionHandle, Attribute, Value, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
|
|
|
|
StringLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetConnectAttrW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumnsW [ODBC32.140]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
WCHAR *SchemaName, SQLSMALLINT NameLength2, WCHAR *TableName,
|
|
|
|
SQLSMALLINT NameLength3, WCHAR *ColumnName, SQLSMALLINT NameLength4)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColumnsW_params params = { StatementHandle, CatalogName, NameLength1, SchemaName,
|
|
|
|
NameLength2, TableName, NameLength3, ColumnName, NameLength4 };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
|
|
|
|
" NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle,
|
|
|
|
debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(ColumnName, NameLength4), NameLength4);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColumnsW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDriverConnectW [ODBC32.141]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandle, WCHAR *InConnectionString,
|
|
|
|
SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength,
|
|
|
|
SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDriverConnectW_params params = { ConnectionHandle, WindowHandle, InConnectionString, Length,
|
|
|
|
OutConnectionString, BufferLength, Length2, DriverCompletion };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p,"
|
|
|
|
" BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle,
|
|
|
|
debugstr_wn(InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2,
|
|
|
|
DriverCompletion);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDriverConnectW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetConnectOptionW [ODBC32.142]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetConnectOptionW_params params = { ConnectionHandle, Option, Value };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetConnectOptionW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetInfoW [ODBC32.145]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetInfoW_params params = { ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle,
|
|
|
|
InfoType, InfoValue, BufferLength, StringLength);
|
|
|
|
|
|
|
|
if (!InfoValue)
|
|
|
|
{
|
|
|
|
WARN("Unexpected NULL InfoValue address\n");
|
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetInfoW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetTypeInfoW [ODBC32.147]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetTypeInfoW_params params = { StatementHandle, DataType };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetTypeInfoW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetConnectOptionW [ODBC32.150]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLLEN Value)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetConnectOptionW_params params = { ConnectionHandle, Option, Value };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqllen(Value));
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetConnectOptionW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSpecialColumnsW [ODBC32.152]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType,
|
|
|
|
SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, SQLWCHAR *SchemaName,
|
|
|
|
SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3,
|
|
|
|
SQLUSMALLINT Scope, SQLUSMALLINT Nullable)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSpecialColumnsW_params params = { StatementHandle, IdentifierType, CatalogName, NameLength1,
|
|
|
|
SchemaName, NameLength2, TableName, NameLength3, Scope, Nullable };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d,"
|
|
|
|
" TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType,
|
|
|
|
debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_wn(TableName, NameLength3), NameLength3, Scope, Nullable);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSpecialColumnsW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLStatisticsW [ODBC32.153]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName,
|
|
|
|
SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLStatisticsW_params params = { StatementHandle, CatalogName, NameLength1, SchemaName,
|
|
|
|
NameLength2, TableName, NameLength3, Unique, Reserved };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s"
|
|
|
|
" NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle,
|
|
|
|
debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_wn(TableName, NameLength3), NameLength3, Unique, Reserved);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLStatisticsW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTablesW [ODBC32.154]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
|
|
|
|
SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName,
|
|
|
|
SQLSMALLINT NameLength3, SQLWCHAR *TableType, SQLSMALLINT NameLength4)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLTablesW_params params = { StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2,
|
|
|
|
TableName, NameLength3, TableType, NameLength4 };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
|
|
|
|
" NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle,
|
|
|
|
debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2,
|
|
|
|
debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(TableType, NameLength4), NameLength4);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLTablesW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLBrowseConnectW [ODBC32.155]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn,
|
|
|
|
SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax,
|
|
|
|
SQLSMALLINT *pcbConnStrOut)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLBrowseConnectW_params params = { hdbc, szConnStrIn, cbConnStrIn, szConnStrOut,
|
|
|
|
cbConnStrOutMax, pcbConnStrOut };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n",
|
|
|
|
hdbc, debugstr_wn(szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLBrowseConnectW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLColumnPrivilegesW [ODBC32.156]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLColumnPrivilegesW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szTableName, cbTableName, szColumnName,
|
|
|
|
cbColumnName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
|
|
|
|
" cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt,
|
|
|
|
debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_wn(szTableName, cbTableName), cbTableName,
|
|
|
|
debugstr_wn(szColumnName, cbColumnName), cbColumnName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLColumnPrivilegesW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDataSourcesW [ODBC32.157]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, WCHAR *ServerName,
|
|
|
|
SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description,
|
|
|
|
SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDataSourcesW_params params = { EnvironmentHandle, Direction, ServerName, BufferLength1,
|
|
|
|
NameLength1, Description, BufferLength2, NameLength2 };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p,"
|
|
|
|
" BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1,
|
|
|
|
NameLength1, Description, BufferLength2, NameLength2);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDataSourcesW, ¶ms );
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
if (ret >= 0 && TRACE_ON(odbc))
|
|
|
|
{
|
|
|
|
if (ServerName && NameLength1 && *NameLength1 > 0)
|
|
|
|
TRACE(" DataSource %s", debugstr_wn(ServerName, *NameLength1));
|
|
|
|
if (Description && NameLength2 && *NameLength2 > 0)
|
|
|
|
TRACE(" Description %s", debugstr_wn(Description, *NameLength2));
|
|
|
|
TRACE("\n");
|
|
|
|
}
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLForeignKeysW [ODBC32.160]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName,
|
|
|
|
SQLWCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLWCHAR *szPkTableName,
|
|
|
|
SQLSMALLINT cbPkTableName, SQLWCHAR *szFkCatalogName,
|
|
|
|
SQLSMALLINT cbFkCatalogName, SQLWCHAR *szFkSchemaName,
|
|
|
|
SQLSMALLINT cbFkSchemaName, SQLWCHAR *szFkTableName, SQLSMALLINT cbFkTableName)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLForeignKeysW_params params = { hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName,
|
|
|
|
cbPkSchemaName, szPkTableName, cbPkTableName, szFkCatalogName,
|
|
|
|
cbFkCatalogName, szFkSchemaName, cbFkSchemaName, szFkTableName,
|
|
|
|
cbFkTableName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d,"
|
|
|
|
" szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s,"
|
|
|
|
" cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt,
|
|
|
|
debugstr_wn(szPkCatalogName, cbPkCatalogName), cbPkCatalogName,
|
|
|
|
debugstr_wn(szPkSchemaName, cbPkSchemaName), cbPkSchemaName,
|
|
|
|
debugstr_wn(szPkTableName, cbPkTableName), cbPkTableName,
|
|
|
|
debugstr_wn(szFkCatalogName, cbFkCatalogName), cbFkCatalogName,
|
|
|
|
debugstr_wn(szFkSchemaName, cbFkSchemaName), cbFkSchemaName,
|
|
|
|
debugstr_wn(szFkTableName, cbFkTableName), cbFkTableName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLForeignKeysW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLNativeSqlW [ODBC32.162]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr,
|
|
|
|
SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLNativeSqlW_params params = { hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc,
|
|
|
|
debugstr_wn(szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLNativeSqlW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLPrimaryKeysW [ODBC32.165]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLPrimaryKeysW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szTableName, cbTableName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
|
|
|
|
" cbTableName %d)\n", hstmt,
|
|
|
|
debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_wn(szTableName, cbTableName), cbTableName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLPrimaryKeysW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProcedureColumnsW [ODBC32.166]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName,
|
|
|
|
SQLSMALLINT cbProcName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLProcedureColumnsW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szProcName, cbProcName,
|
|
|
|
szColumnName, cbColumnName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
|
|
|
|
" cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt,
|
|
|
|
debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName,
|
|
|
|
debugstr_wn(szProcName, cbProcName), cbProcName,
|
|
|
|
debugstr_wn(szColumnName, cbColumnName), cbColumnName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLProcedureColumnsW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLProceduresW [ODBC32.167]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLProceduresW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName,
|
|
|
|
SQLSMALLINT cbProcName)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLProceduresW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szProcName, cbProcName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
|
|
|
|
" cbProcName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szProcName, cbProcName), cbProcName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLProceduresW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLTablePrivilegesW [ODBC32.170]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
|
|
|
|
SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName,
|
|
|
|
SQLSMALLINT cbTableName)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLTablePrivilegesW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName,
|
|
|
|
cbSchemaName, szTableName, cbTableName };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
|
|
|
|
" cbTableName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName,
|
|
|
|
debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szTableName, cbTableName), cbTableName);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLTablePrivilegesW, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLDriversW [ODBC32.171]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLWCHAR *szDriverDesc,
|
|
|
|
SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc,
|
|
|
|
SQLWCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax,
|
|
|
|
SQLSMALLINT *pcbDriverAttr)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLDriversW_params params = { EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax,
|
|
|
|
pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p,"
|
|
|
|
" DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection,
|
|
|
|
szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
|
2015-01-21 23:16:41 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLDriversW, ¶ms );
|
2015-01-21 23:16:41 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST)
|
|
|
|
ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n");
|
2015-01-21 23:16:41 +01:00
|
|
|
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetDescFieldW [ODBC32.173]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
|
|
|
SQLPOINTER Value, SQLINTEGER BufferLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetDescFieldW_params params = { DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle,
|
|
|
|
RecNumber, FieldIdentifier, Value, BufferLength);
|
2005-01-25 20:04:03 +01:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetDescFieldW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SQLSetStmtAttrW [ODBC32.176]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
|
|
|
|
SQLINTEGER StringLength)
|
2005-01-25 20:04:03 +01:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLSetStmtAttrW_params params = { StatementHandle, Attribute, Value, StringLength };
|
2019-02-05 21:22:55 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value,
|
|
|
|
StringLength);
|
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLSetStmtAttrW, ¶ms );
|
2019-02-05 21:22:55 +01:00
|
|
|
if (ret == SQL_ERROR && (Attribute == SQL_ROWSET_SIZE || Attribute == SQL_ATTR_ROW_ARRAY_SIZE))
|
|
|
|
{
|
|
|
|
TRACE("CHEAT: returning SQL_SUCCESS to ADO\n");
|
|
|
|
return SQL_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2005-01-25 20:04:03 +01:00
|
|
|
}
|
|
|
|
|
2018-08-13 17:44:51 +02:00
|
|
|
/*************************************************************************
|
|
|
|
* SQLGetDiagRecA [ODBC32.236]
|
|
|
|
*/
|
2020-10-01 12:11:29 +02:00
|
|
|
SQLRETURN WINAPI SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
|
|
|
|
SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText,
|
|
|
|
SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
|
2018-08-13 17:44:51 +02:00
|
|
|
{
|
2021-08-11 14:13:47 +02:00
|
|
|
struct SQLGetDiagRecA_params params = { HandleType, Handle, RecNumber, Sqlstate, NativeError,
|
|
|
|
MessageText, BufferLength, TextLength };
|
2019-02-05 21:22:57 +01:00
|
|
|
SQLRETURN ret;
|
|
|
|
|
|
|
|
TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d,"
|
|
|
|
" TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength,
|
|
|
|
TextLength);
|
2018-08-13 17:44:51 +02:00
|
|
|
|
2021-08-11 14:13:47 +02:00
|
|
|
ret = ODBC_CALL( SQLGetDiagRecA, ¶ms );
|
2019-02-05 21:22:57 +01:00
|
|
|
TRACE("Returning %d\n", ret);
|
|
|
|
return ret;
|
2018-08-13 17:44:51 +02:00
|
|
|
}
|
2020-10-01 12:14:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllMain [Internal] Initializes the internal 'ODBC32.DLL'.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
|
|
|
|
{
|
|
|
|
TRACE("proxy ODBC: %p,%x,%p\n", hinstDLL, reason, reserved);
|
|
|
|
|
|
|
|
switch (reason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
2021-08-11 14:13:47 +02:00
|
|
|
if (!NtQueryVirtualMemory( GetCurrentProcess(), hinstDLL, MemoryWineUnixFuncs,
|
|
|
|
&odbc_handle, sizeof(odbc_handle), NULL ) &&
|
|
|
|
!__wine_unix_call( odbc_handle, process_attach, NULL))
|
|
|
|
{
|
|
|
|
ODBC_ReplicateToRegistry();
|
|
|
|
}
|
2020-10-01 12:14:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
if (reserved) break;
|
2021-08-11 14:13:47 +02:00
|
|
|
__wine_unix_call( odbc_handle, process_detach, NULL );
|
2020-10-01 12:14:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|