4 * Copyright 1999 Xiang Li, Corel Corporation
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 * Proxy ODBC driver manager. This manager delegates all ODBC
22 * calls to a real ODBC driver manager named by the environment
23 * variable LIB_ODBC_DRIVER_MANAGER, or to libodbc.so if the
24 * variable is not set.
38 #include "wine/debug.h"
45 WINE_DEFAULT_DEBUG_CHANNEL(odbc
);
46 WINE_DECLARE_DEBUG_CHANNEL(winediag
);
48 static unixlib_handle_t odbc_handle
;
50 #define ODBC_CALL( func, params ) __wine_unix_call( odbc_handle, unix_ ## func, params )
52 /***********************************************************************
53 * ODBC_ReplicateODBCInstToRegistry
59 * Utility to ODBC_ReplicateToRegistry to replicate the drivers of the
60 * ODBCINST.INI settings
62 * The driver settings are not replicated to the registry. If we were to
63 * replicate them we would need to decide whether to replicate all settings
64 * or to do some translation; whether to remove any entries present only in
65 * the windows registry, etc.
68 static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv
)
75 TRACE ("Driver settings are not currently replicated to the registry\n");
76 if ((reg_ret
= RegCreateKeyExA (HKEY_LOCAL_MACHINE
,
77 "Software\\ODBC\\ODBCINST.INI", 0, NULL
,
78 REG_OPTION_NON_VOLATILE
,
79 KEY_ALL_ACCESS
/* a couple more than we need */, NULL
,
80 &hODBCInst
, NULL
)) == ERROR_SUCCESS
)
83 if ((reg_ret
= RegCreateKeyExA (hODBCInst
, "ODBC Drivers", 0,
84 NULL
, REG_OPTION_NON_VOLATILE
,
85 KEY_ALL_ACCESS
/* overkill */, NULL
, &hDrivers
, NULL
))
94 dirn
= SQL_FETCH_FIRST
;
95 while ((sql_ret
= SQLDrivers (hEnv
, dirn
, (SQLCHAR
*)desc
, sizeof(desc
),
96 &sizedesc
, NULL
, 0, NULL
)) == SQL_SUCCESS
||
97 sql_ret
== SQL_SUCCESS_WITH_INFO
)
99 /* FIXME Do some proper handling of the SUCCESS_WITH_INFO */
100 dirn
= SQL_FETCH_NEXT
;
101 if (sizedesc
== lstrlenA(desc
))
104 if ((reg_ret
= RegQueryValueExA (hDrivers
, desc
, NULL
,
105 NULL
, NULL
, NULL
)) == ERROR_FILE_NOT_FOUND
)
107 if ((reg_ret
= RegSetValueExA (hDrivers
, desc
, 0,
108 REG_SZ
, (const BYTE
*)"Installed", 10)) != ERROR_SUCCESS
)
110 TRACE ("Error %ld replicating driver %s\n",
115 else if (reg_ret
!= ERROR_SUCCESS
)
117 TRACE ("Error %ld checking for %s in drivers\n",
121 if ((reg_ret
= RegCreateKeyExA (hODBCInst
, desc
, 0,
122 NULL
, REG_OPTION_NON_VOLATILE
,
123 KEY_ALL_ACCESS
, NULL
, &hThis
, NULL
))
126 /* FIXME This is where the settings go.
127 * I suggest that if the disposition says it
128 * exists then we leave it alone. Alternatively
129 * include an extra value to flag that it is
130 * a replication of the unixODBC/iODBC/...
132 if ((reg_ret
= RegCloseKey (hThis
)) !=
134 TRACE ("Error %ld closing %s key\n", reg_ret
,
139 TRACE ("Error %ld ensuring driver key %s\n",
146 WARN ("Unusually long driver name %s not replicated\n",
151 if (sql_ret
!= SQL_NO_DATA
)
153 TRACE ("Error %d enumerating drivers\n", (int)sql_ret
);
156 if ((reg_ret
= RegCloseKey (hDrivers
)) != ERROR_SUCCESS
)
158 TRACE ("Error %ld closing hDrivers\n", reg_ret
);
163 TRACE ("Error %ld opening HKLM\\S\\O\\OI\\Drivers\n", reg_ret
);
165 if ((reg_ret
= RegCloseKey (hODBCInst
)) != ERROR_SUCCESS
)
167 TRACE ("Error %ld closing HKLM\\S\\O\\ODBCINST.INI\n", reg_ret
);
172 TRACE ("Error %ld opening HKLM\\S\\O\\ODBCINST.INI\n", reg_ret
);
176 WARN ("May not have replicated all ODBC drivers to the registry\n");
180 /***********************************************************************
181 * ODBC_ReplicateODBCToRegistry
187 * Utility to ODBC_ReplicateToRegistry to replicate either the USER or
190 * For now simply place the "Driver description" (as returned by SQLDataSources)
191 * into the registry as the driver. This is enough to satisfy Crystal's
192 * requirement that there be a driver entry. (It doesn't seem to care what
194 * A slightly more accurate setting would be to access the registry to find
195 * the actual driver library for the given description (which appears to map
196 * to one of the HKLM/Software/ODBC/ODBCINST.INI keys). (If you do this note
197 * that this will add a requirement that this function be called after
198 * ODBC_ReplicateODBCInstToRegistry)
200 static void ODBC_ReplicateODBCToRegistry (BOOL is_user
, SQLHENV hEnv
)
206 CHAR dsn
[SQL_MAX_DSN_LENGTH
+ 1];
209 SQLSMALLINT sizedesc
;
211 const char *which
= is_user
? "user" : "system";
214 if ((reg_ret
= RegCreateKeyExA (
215 is_user
? HKEY_CURRENT_USER
: HKEY_LOCAL_MACHINE
,
216 "Software\\ODBC\\ODBC.INI", 0, NULL
, REG_OPTION_NON_VOLATILE
,
217 KEY_ALL_ACCESS
/* a couple more than we need */, NULL
, &hODBC
,
218 NULL
)) == ERROR_SUCCESS
)
221 dirn
= is_user
? SQL_FETCH_FIRST_USER
: SQL_FETCH_FIRST_SYSTEM
;
222 while ((sql_ret
= SQLDataSources (hEnv
, dirn
,
223 (SQLCHAR
*)dsn
, sizeof(dsn
), &sizedsn
,
224 (SQLCHAR
*)desc
, sizeof(desc
), &sizedesc
)) == SQL_SUCCESS
225 || sql_ret
== SQL_SUCCESS_WITH_INFO
)
227 /* FIXME Do some proper handling of the SUCCESS_WITH_INFO */
228 dirn
= SQL_FETCH_NEXT
;
229 if (sizedsn
== lstrlenA(dsn
) && sizedesc
== lstrlenA(desc
))
232 if ((reg_ret
= RegCreateKeyExA (hODBC
, dsn
, 0,
233 NULL
, REG_OPTION_NON_VOLATILE
,
234 KEY_ALL_ACCESS
, NULL
, &hDSN
, NULL
))
237 static const char DRIVERKEY
[] = "Driver";
238 if ((reg_ret
= RegQueryValueExA (hDSN
, DRIVERKEY
,
239 NULL
, NULL
, NULL
, NULL
))
240 == ERROR_FILE_NOT_FOUND
)
242 if ((reg_ret
= RegSetValueExA (hDSN
, DRIVERKEY
, 0,
243 REG_SZ
, (LPBYTE
)desc
, sizedesc
)) != ERROR_SUCCESS
)
245 TRACE ("Error %ld replicating description of "
246 "%s(%s)\n", reg_ret
, dsn
, desc
);
250 else if (reg_ret
!= ERROR_SUCCESS
)
252 TRACE ("Error %ld checking for description of %s\n",
256 if ((reg_ret
= RegCloseKey (hDSN
)) != ERROR_SUCCESS
)
258 TRACE ("Error %ld closing %s DSN key %s\n",
259 reg_ret
, which
, dsn
);
264 TRACE ("Error %ld opening %s DSN key %s\n",
265 reg_ret
, which
, dsn
);
271 WARN ("Unusually long %s data source name %s (%s) not "
272 "replicated\n", which
, dsn
, desc
);
276 if (sql_ret
!= SQL_NO_DATA
)
278 TRACE ("Error %d enumerating %s datasources\n",
279 (int)sql_ret
, which
);
282 if ((reg_ret
= RegCloseKey (hODBC
)) != ERROR_SUCCESS
)
284 TRACE ("Error %ld closing %s ODBC.INI registry key\n", reg_ret
,
290 TRACE ("Error %ld creating/opening %s ODBC.INI registry key\n",
295 WARN ("May not have replicated all %s ODBC DSNs to the registry\n",
300 /***********************************************************************
301 * ODBC_ReplicateToRegistry
307 * Unfortunately some of the functions that Windows documents as being part
308 * of the ODBC API it implements directly during compilation or something
309 * in terms of registry access functions.
310 * e.g. SQLGetInstalledDrivers queries the list at
311 * HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers
313 * This function is called when the driver manager is loaded and is used
314 * to replicate the appropriate details into the Wine registry
317 static void ODBC_ReplicateToRegistry (void)
322 if ((sql_ret
= SQLAllocEnv(&hEnv
)) == SQL_SUCCESS
)
324 ODBC_ReplicateODBCInstToRegistry (hEnv
);
325 ODBC_ReplicateODBCToRegistry (FALSE
/* system dsns */, hEnv
);
326 ODBC_ReplicateODBCToRegistry (TRUE
/* user dsns */, hEnv
);
328 if ((sql_ret
= SQLFreeEnv(hEnv
)) != SQL_SUCCESS
)
330 TRACE ("Error %d freeing the SQL environment.\n", (int)sql_ret
);
335 TRACE ("Error %d opening an SQL environment.\n", (int)sql_ret
);
336 WARN ("The external ODBC settings have not been replicated to the"
341 /*************************************************************************
342 * SQLAllocConnect [ODBC32.001]
344 SQLRETURN WINAPI
SQLAllocConnect(SQLHENV EnvironmentHandle
, SQLHDBC
*ConnectionHandle
)
346 struct SQLAllocConnect_params params
= { EnvironmentHandle
, ConnectionHandle
};
349 TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle
, ConnectionHandle
);
351 *ConnectionHandle
= SQL_NULL_HDBC
;
352 ret
= ODBC_CALL( SQLAllocConnect
, ¶ms
);
353 TRACE("Returning %d, ConnectionHandle %p\n", ret
, *ConnectionHandle
);
357 /*************************************************************************
358 * SQLAllocEnv [ODBC32.002]
360 SQLRETURN WINAPI
SQLAllocEnv(SQLHENV
*EnvironmentHandle
)
362 struct SQLAllocEnv_params params
= { EnvironmentHandle
};
365 TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle
);
367 *EnvironmentHandle
= SQL_NULL_HENV
;
368 ret
= ODBC_CALL( SQLAllocEnv
, ¶ms
);
369 TRACE("Returning %d, EnvironmentHandle %p\n", ret
, *EnvironmentHandle
);
373 /*************************************************************************
374 * SQLAllocHandle [ODBC32.024]
376 SQLRETURN WINAPI
SQLAllocHandle(SQLSMALLINT HandleType
, SQLHANDLE InputHandle
, SQLHANDLE
*OutputHandle
)
378 struct SQLAllocHandle_params params
= { HandleType
, InputHandle
, OutputHandle
};
381 TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType
, InputHandle
, OutputHandle
);
384 ret
= ODBC_CALL( SQLAllocHandle
, ¶ms
);
385 TRACE("Returning %d, Handle %p\n", ret
, *OutputHandle
);
389 /*************************************************************************
390 * SQLAllocStmt [ODBC32.003]
392 SQLRETURN WINAPI
SQLAllocStmt(SQLHDBC ConnectionHandle
, SQLHSTMT
*StatementHandle
)
394 struct SQLAllocStmt_params params
= { ConnectionHandle
, StatementHandle
};
397 TRACE("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle
, StatementHandle
);
399 *StatementHandle
= SQL_NULL_HSTMT
;
400 ret
= ODBC_CALL( SQLAllocStmt
, ¶ms
);
401 TRACE ("Returning %d, StatementHandle %p\n", ret
, *StatementHandle
);
405 /*************************************************************************
406 * SQLAllocHandleStd [ODBC32.077]
408 SQLRETURN WINAPI
SQLAllocHandleStd(SQLSMALLINT HandleType
, SQLHANDLE InputHandle
, SQLHANDLE
*OutputHandle
)
410 struct SQLAllocHandleStd_params params
= { HandleType
, InputHandle
, OutputHandle
};
413 TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType
, InputHandle
, OutputHandle
);
416 ret
= ODBC_CALL( SQLAllocHandleStd
, ¶ms
);
417 TRACE ("Returning %d, OutputHandle %p\n", ret
, *OutputHandle
);
421 static const char *debugstr_sqllen( SQLLEN len
)
424 return wine_dbg_sprintf( "%Id", len
);
426 return wine_dbg_sprintf( "%d", len
);
430 /*************************************************************************
431 * SQLBindCol [ODBC32.004]
433 SQLRETURN WINAPI
SQLBindCol(SQLHSTMT StatementHandle
, SQLUSMALLINT ColumnNumber
, SQLSMALLINT TargetType
,
434 SQLPOINTER TargetValue
, SQLLEN BufferLength
, SQLLEN
*StrLen_or_Ind
)
436 struct SQLBindCol_params params
= { StatementHandle
, ColumnNumber
, TargetType
, TargetValue
,
437 BufferLength
, StrLen_or_Ind
};
440 TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n",
441 StatementHandle
, ColumnNumber
, TargetType
, TargetValue
, debugstr_sqllen(BufferLength
), StrLen_or_Ind
);
443 ret
= ODBC_CALL( SQLBindCol
, ¶ms
);
444 TRACE ("Returning %d\n", ret
);
448 static const char *debugstr_sqlulen( SQLULEN len
)
451 return wine_dbg_sprintf( "%Iu", len
);
453 return wine_dbg_sprintf( "%u", len
);
457 /*************************************************************************
458 * SQLBindParam [ODBC32.025]
460 SQLRETURN WINAPI
SQLBindParam(SQLHSTMT StatementHandle
, SQLUSMALLINT ParameterNumber
, SQLSMALLINT ValueType
,
461 SQLSMALLINT ParameterType
, SQLULEN LengthPrecision
, SQLSMALLINT ParameterScale
,
462 SQLPOINTER ParameterValue
, SQLLEN
*StrLen_or_Ind
)
464 struct SQLBindParam_params params
= { StatementHandle
, ParameterNumber
, ValueType
, ParameterType
,
465 LengthPrecision
, ParameterScale
, ParameterValue
, StrLen_or_Ind
};
468 TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s,"
469 " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle
, ParameterNumber
, ValueType
,
470 ParameterType
, debugstr_sqlulen(LengthPrecision
), ParameterScale
, ParameterValue
, StrLen_or_Ind
);
472 ret
= ODBC_CALL( SQLBindParam
, ¶ms
);
473 TRACE ("Returning %d\n", ret
);
477 /*************************************************************************
478 * SQLCancel [ODBC32.005]
480 SQLRETURN WINAPI
SQLCancel(SQLHSTMT StatementHandle
)
482 struct SQLCancel_params params
= { StatementHandle
};
485 TRACE("(StatementHandle %p)\n", StatementHandle
);
487 ret
= ODBC_CALL( SQLCancel
, ¶ms
);
488 TRACE("Returning %d\n", ret
);
492 /*************************************************************************
493 * SQLCloseCursor [ODBC32.026]
495 SQLRETURN WINAPI
SQLCloseCursor(SQLHSTMT StatementHandle
)
497 struct SQLCloseCursor_params params
= { StatementHandle
};
500 TRACE("(StatementHandle %p)\n", StatementHandle
);
502 ret
= ODBC_CALL( SQLCloseCursor
, ¶ms
);
503 TRACE("Returning %d\n", ret
);
507 /*************************************************************************
508 * SQLColAttribute [ODBC32.027]
510 SQLRETURN WINAPI
SQLColAttribute(SQLHSTMT StatementHandle
, SQLUSMALLINT ColumnNumber
,
511 SQLUSMALLINT FieldIdentifier
, SQLPOINTER CharacterAttribute
,
512 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
,
513 SQLLEN
*NumericAttribute
)
515 struct SQLColAttribute_params params
= { StatementHandle
, ColumnNumber
, FieldIdentifier
,
516 CharacterAttribute
, BufferLength
, StringLength
, NumericAttribute
};
519 TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d,"
520 " StringLength %p, NumericAttribute %p)\n", StatementHandle
, ColumnNumber
, FieldIdentifier
,
521 CharacterAttribute
, BufferLength
, StringLength
, NumericAttribute
);
523 ret
= ODBC_CALL( SQLColAttribute
, ¶ms
);
524 TRACE("Returning %d\n", ret
);
528 /*************************************************************************
529 * SQLColumns [ODBC32.040]
531 SQLRETURN WINAPI
SQLColumns(SQLHSTMT StatementHandle
, SQLCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
532 SQLCHAR
*SchemaName
, SQLSMALLINT NameLength2
, SQLCHAR
*TableName
,
533 SQLSMALLINT NameLength3
, SQLCHAR
*ColumnName
, SQLSMALLINT NameLength4
)
535 struct SQLColumns_params params
= { StatementHandle
, CatalogName
, NameLength1
, SchemaName
, NameLength2
,
536 TableName
, NameLength3
, ColumnName
, NameLength4
};
539 TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
540 " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle
,
541 debugstr_an((const char *)CatalogName
, NameLength1
), NameLength1
,
542 debugstr_an((const char *)SchemaName
, NameLength2
), NameLength2
,
543 debugstr_an((const char *)TableName
, NameLength3
), NameLength3
,
544 debugstr_an((const char *)ColumnName
, NameLength4
), NameLength4
);
546 ret
= ODBC_CALL( SQLColumns
, ¶ms
);
547 TRACE("Returning %d\n", ret
);
551 /*************************************************************************
552 * SQLConnect [ODBC32.007]
554 SQLRETURN WINAPI
SQLConnect(SQLHDBC ConnectionHandle
, SQLCHAR
*ServerName
, SQLSMALLINT NameLength1
,
555 SQLCHAR
*UserName
, SQLSMALLINT NameLength2
, SQLCHAR
*Authentication
,
556 SQLSMALLINT NameLength3
)
558 struct SQLConnect_params params
= { ConnectionHandle
, ServerName
, NameLength1
, UserName
, NameLength2
,
559 Authentication
, NameLength3
};
562 TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s,"
563 " NameLength3 %d)\n", ConnectionHandle
,
564 debugstr_an((const char *)ServerName
, NameLength1
), NameLength1
,
565 debugstr_an((const char *)UserName
, NameLength2
), NameLength2
,
566 debugstr_an((const char *)Authentication
, NameLength3
), NameLength3
);
568 ret
= ODBC_CALL( SQLConnect
, ¶ms
);
569 TRACE("Returning %d\n", ret
);
573 /*************************************************************************
574 * SQLCopyDesc [ODBC32.028]
576 SQLRETURN WINAPI
SQLCopyDesc(SQLHDESC SourceDescHandle
, SQLHDESC TargetDescHandle
)
578 struct SQLCopyDesc_params params
= { SourceDescHandle
, TargetDescHandle
};
581 TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle
, TargetDescHandle
);
583 ret
= ODBC_CALL( SQLCopyDesc
, ¶ms
);
584 TRACE("Returning %d\n", ret
);
588 /*************************************************************************
589 * SQLDataSources [ODBC32.057]
591 SQLRETURN WINAPI
SQLDataSources(SQLHENV EnvironmentHandle
, SQLUSMALLINT Direction
, SQLCHAR
*ServerName
,
592 SQLSMALLINT BufferLength1
, SQLSMALLINT
*NameLength1
, SQLCHAR
*Description
,
593 SQLSMALLINT BufferLength2
, SQLSMALLINT
*NameLength2
)
595 struct SQLDataSources_params params
= { EnvironmentHandle
, Direction
, ServerName
, BufferLength1
,
596 NameLength1
, Description
, BufferLength2
, NameLength2
};
599 TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p,"
600 " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle
, Direction
, ServerName
, BufferLength1
,
601 NameLength1
, Description
, BufferLength2
, NameLength2
);
603 ret
= ODBC_CALL( SQLDataSources
, ¶ms
);
604 if (ret
>= 0 && TRACE_ON(odbc
))
606 if (ServerName
&& NameLength1
&& *NameLength1
> 0)
607 TRACE(" DataSource %s", debugstr_an((const char *)ServerName
, *NameLength1
));
608 if (Description
&& NameLength2
&& *NameLength2
> 0)
609 TRACE(" Description %s", debugstr_an((const char *)Description
, *NameLength2
));
613 TRACE("Returning %d\n", ret
);
617 SQLRETURN WINAPI
SQLDataSourcesA(SQLHENV EnvironmentHandle
, SQLUSMALLINT Direction
, SQLCHAR
*ServerName
,
618 SQLSMALLINT BufferLength1
, SQLSMALLINT
*NameLength1
, SQLCHAR
*Description
,
619 SQLSMALLINT BufferLength2
, SQLSMALLINT
*NameLength2
)
621 struct SQLDataSourcesA_params params
= { EnvironmentHandle
, Direction
, ServerName
, BufferLength1
,
622 NameLength1
, Description
, BufferLength2
, NameLength2
};
625 TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p,"
626 " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle
, Direction
, ServerName
, BufferLength1
,
627 NameLength1
, Description
, BufferLength2
, NameLength2
);
629 ret
= ODBC_CALL( SQLDataSourcesA
, ¶ms
);
632 if (ServerName
&& NameLength1
&& *NameLength1
> 0)
633 TRACE(" DataSource %s", debugstr_an((const char *)ServerName
, *NameLength1
));
634 if (Description
&& NameLength2
&& *NameLength2
> 0)
635 TRACE(" Description %s", debugstr_an((const char *)Description
, *NameLength2
));
639 TRACE("Returning %d\n", ret
);
643 /*************************************************************************
644 * SQLDescribeCol [ODBC32.008]
646 SQLRETURN WINAPI
SQLDescribeCol(SQLHSTMT StatementHandle
, SQLUSMALLINT ColumnNumber
, SQLCHAR
*ColumnName
,
647 SQLSMALLINT BufferLength
, SQLSMALLINT
*NameLength
, SQLSMALLINT
*DataType
,
648 SQLULEN
*ColumnSize
, SQLSMALLINT
*DecimalDigits
, SQLSMALLINT
*Nullable
)
650 struct SQLDescribeCol_params params
= { StatementHandle
, ColumnNumber
, ColumnName
, BufferLength
,
651 NameLength
, DataType
, ColumnSize
, DecimalDigits
, Nullable
};
655 TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p,"
656 " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle
, ColumnNumber
, ColumnName
,
657 BufferLength
, NameLength
, DataType
, ColumnSize
, DecimalDigits
, Nullable
);
659 if (!params
.NameLength
) params
.NameLength
= &dummy
; /* workaround for drivers that don't accept NULL NameLength */
661 ret
= ODBC_CALL( SQLDescribeCol
, ¶ms
);
664 if (ColumnName
&& NameLength
) TRACE(" ColumnName %s\n", debugstr_an((const char *)ColumnName
, *NameLength
));
665 if (DataType
) TRACE(" DataType %d\n", *DataType
);
666 if (ColumnSize
) TRACE(" ColumnSize %s\n", debugstr_sqlulen(*ColumnSize
));
667 if (DecimalDigits
) TRACE(" DecimalDigits %d\n", *DecimalDigits
);
668 if (Nullable
) TRACE(" Nullable %d\n", *Nullable
);
671 TRACE("Returning %d\n", ret
);
675 /*************************************************************************
676 * SQLDisconnect [ODBC32.009]
678 SQLRETURN WINAPI
SQLDisconnect(SQLHDBC ConnectionHandle
)
680 struct SQLDisconnect_params params
= { ConnectionHandle
};
683 TRACE("(ConnectionHandle %p)\n", ConnectionHandle
);
685 ret
= ODBC_CALL( SQLDisconnect
, ¶ms
);
686 TRACE("Returning %d\n", ret
);
690 /*************************************************************************
691 * SQLEndTran [ODBC32.029]
693 SQLRETURN WINAPI
SQLEndTran(SQLSMALLINT HandleType
, SQLHANDLE Handle
, SQLSMALLINT CompletionType
)
695 struct SQLEndTran_params params
= { HandleType
, Handle
, CompletionType
};
698 TRACE("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType
, Handle
, CompletionType
);
700 ret
= ODBC_CALL( SQLEndTran
, ¶ms
);
701 TRACE("Returning %d\n", ret
);
705 /*************************************************************************
706 * SQLError [ODBC32.010]
708 SQLRETURN WINAPI
SQLError(SQLHENV EnvironmentHandle
, SQLHDBC ConnectionHandle
, SQLHSTMT StatementHandle
,
709 SQLCHAR
*Sqlstate
, SQLINTEGER
*NativeError
, SQLCHAR
*MessageText
,
710 SQLSMALLINT BufferLength
, SQLSMALLINT
*TextLength
)
712 struct SQLError_params params
= { EnvironmentHandle
, ConnectionHandle
, StatementHandle
, Sqlstate
,
713 NativeError
, MessageText
, BufferLength
, TextLength
};
716 TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p,"
717 " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle
, ConnectionHandle
,
718 StatementHandle
, Sqlstate
, NativeError
, MessageText
, BufferLength
, TextLength
);
720 ret
= ODBC_CALL( SQLError
, ¶ms
);
722 if (ret
== SQL_SUCCESS
)
724 TRACE(" SQLState %s\n", debugstr_an((const char *)Sqlstate
, 5));
725 TRACE(" Error %d\n", *NativeError
);
726 TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText
, *TextLength
));
729 TRACE("Returning %d\n", ret
);
733 /*************************************************************************
734 * SQLExecDirect [ODBC32.011]
736 SQLRETURN WINAPI
SQLExecDirect(SQLHSTMT StatementHandle
, SQLCHAR
*StatementText
, SQLINTEGER TextLength
)
738 struct SQLExecDirect_params params
= { StatementHandle
, StatementText
, TextLength
};
741 TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle
,
742 debugstr_an((const char *)StatementText
, TextLength
), TextLength
);
744 ret
= ODBC_CALL( SQLExecDirect
, ¶ms
);
745 TRACE("Returning %d\n", ret
);
749 /*************************************************************************
750 * SQLExecute [ODBC32.012]
752 SQLRETURN WINAPI
SQLExecute(SQLHSTMT StatementHandle
)
754 struct SQLExecute_params params
= { StatementHandle
};
757 TRACE("(StatementHandle %p)\n", StatementHandle
);
759 ret
= ODBC_CALL( SQLExecute
, ¶ms
);
760 TRACE("Returning %d\n", ret
);
764 /*************************************************************************
765 * SQLFetch [ODBC32.013]
767 SQLRETURN WINAPI
SQLFetch(SQLHSTMT StatementHandle
)
769 struct SQLFetch_params params
= { StatementHandle
};
772 TRACE("(StatementHandle %p)\n", StatementHandle
);
774 ret
= ODBC_CALL( SQLFetch
, ¶ms
);
775 TRACE("Returning %d\n", ret
);
779 /*************************************************************************
780 * SQLFetchScroll [ODBC32.030]
782 SQLRETURN WINAPI
SQLFetchScroll(SQLHSTMT StatementHandle
, SQLSMALLINT FetchOrientation
, SQLLEN FetchOffset
)
784 struct SQLFetchScroll_params params
= { StatementHandle
, FetchOrientation
, FetchOffset
};
787 TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle
, FetchOrientation
,
788 debugstr_sqllen(FetchOffset
));
790 ret
= ODBC_CALL( SQLFetchScroll
, ¶ms
);
791 TRACE("Returning %d\n", ret
);
795 /*************************************************************************
796 * SQLFreeConnect [ODBC32.014]
798 SQLRETURN WINAPI
SQLFreeConnect(SQLHDBC ConnectionHandle
)
800 struct SQLFreeConnect_params params
= { ConnectionHandle
};
803 TRACE("(ConnectionHandle %p)\n", ConnectionHandle
);
805 ret
= ODBC_CALL( SQLFreeConnect
, ¶ms
);
806 TRACE("Returning %d\n", ret
);
810 /*************************************************************************
811 * SQLFreeEnv [ODBC32.015]
813 SQLRETURN WINAPI
SQLFreeEnv(SQLHENV EnvironmentHandle
)
815 struct SQLFreeEnv_params params
= { EnvironmentHandle
};
818 TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle
);
820 ret
= ODBC_CALL( SQLFreeEnv
, ¶ms
);
821 TRACE("Returning %d\n", ret
);
825 /*************************************************************************
826 * SQLFreeHandle [ODBC32.031]
828 SQLRETURN WINAPI
SQLFreeHandle(SQLSMALLINT HandleType
, SQLHANDLE Handle
)
830 struct SQLFreeHandle_params params
= { HandleType
, Handle
};
833 TRACE("(HandleType %d, Handle %p)\n", HandleType
, Handle
);
835 ret
= ODBC_CALL( SQLFreeHandle
, ¶ms
);
836 TRACE ("Returning %d\n", ret
);
840 /*************************************************************************
841 * SQLFreeStmt [ODBC32.016]
843 SQLRETURN WINAPI
SQLFreeStmt(SQLHSTMT StatementHandle
, SQLUSMALLINT Option
)
845 struct SQLFreeStmt_params params
= { StatementHandle
, Option
};
848 TRACE("(StatementHandle %p, Option %d)\n", StatementHandle
, Option
);
850 ret
= ODBC_CALL( SQLFreeStmt
, ¶ms
);
851 TRACE("Returning %d\n", ret
);
855 /*************************************************************************
856 * SQLGetConnectAttr [ODBC32.032]
858 SQLRETURN WINAPI
SQLGetConnectAttr(SQLHDBC ConnectionHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
859 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
861 struct SQLGetConnectAttr_params params
= { ConnectionHandle
, Attribute
, Value
, BufferLength
, StringLength
};
864 TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle
,
865 Attribute
, Value
, BufferLength
, StringLength
);
867 ret
= ODBC_CALL( SQLGetConnectAttr
, ¶ms
);
868 TRACE("Returning %d\n", ret
);
872 /*************************************************************************
873 * SQLGetConnectOption [ODBC32.042]
875 SQLRETURN WINAPI
SQLGetConnectOption(SQLHDBC ConnectionHandle
, SQLUSMALLINT Option
, SQLPOINTER Value
)
877 struct SQLGetConnectOption_params params
= { ConnectionHandle
, Option
, Value
};
880 TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle
, Option
, Value
);
882 ret
= ODBC_CALL( SQLGetConnectOption
, ¶ms
);
883 TRACE("Returning %d\n", ret
);
887 /*************************************************************************
888 * SQLGetCursorName [ODBC32.017]
890 SQLRETURN WINAPI
SQLGetCursorName(SQLHSTMT StatementHandle
, SQLCHAR
*CursorName
, SQLSMALLINT BufferLength
,
891 SQLSMALLINT
*NameLength
)
893 struct SQLGetCursorName_params params
= { StatementHandle
, CursorName
, BufferLength
, NameLength
};
896 TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle
, CursorName
,
897 BufferLength
, NameLength
);
899 ret
= ODBC_CALL( SQLGetCursorName
, ¶ms
);
900 TRACE("Returning %d\n", ret
);
904 /*************************************************************************
905 * SQLGetData [ODBC32.043]
907 SQLRETURN WINAPI
SQLGetData(SQLHSTMT StatementHandle
, SQLUSMALLINT ColumnNumber
, SQLSMALLINT TargetType
,
908 SQLPOINTER TargetValue
, SQLLEN BufferLength
, SQLLEN
*StrLen_or_Ind
)
910 struct SQLGetData_params params
= { StatementHandle
, ColumnNumber
, TargetType
, TargetValue
,
911 BufferLength
, StrLen_or_Ind
};
914 TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n",
915 StatementHandle
, ColumnNumber
, TargetType
, TargetValue
, debugstr_sqllen(BufferLength
), StrLen_or_Ind
);
917 ret
= ODBC_CALL( SQLGetData
, ¶ms
);
918 TRACE("Returning %d\n", ret
);
922 /*************************************************************************
923 * SQLGetDescField [ODBC32.033]
925 SQLRETURN WINAPI
SQLGetDescField(SQLHDESC DescriptorHandle
, SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
926 SQLPOINTER Value
, SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
928 struct SQLGetDescField_params params
= { DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
,
929 BufferLength
, StringLength
};
932 TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n",
933 DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
, BufferLength
, StringLength
);
935 ret
= ODBC_CALL( SQLGetDescField
, ¶ms
);
936 TRACE("Returning %d\n", ret
);
940 /*************************************************************************
941 * SQLGetDescRec [ODBC32.034]
943 SQLRETURN WINAPI
SQLGetDescRec(SQLHDESC DescriptorHandle
, SQLSMALLINT RecNumber
, SQLCHAR
*Name
,
944 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
, SQLSMALLINT
*Type
,
945 SQLSMALLINT
*SubType
, SQLLEN
*Length
, SQLSMALLINT
*Precision
,
946 SQLSMALLINT
*Scale
, SQLSMALLINT
*Nullable
)
948 struct SQLGetDescRec_params params
= { DescriptorHandle
, RecNumber
, Name
, BufferLength
, StringLength
,
949 Type
, SubType
, Length
, Precision
, Scale
, Nullable
};
952 TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p,"
953 " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle
, RecNumber
, Name
, BufferLength
,
954 StringLength
, Type
, SubType
, Length
, Precision
, Scale
, Nullable
);
956 ret
= ODBC_CALL( SQLGetDescRec
, ¶ms
);
957 TRACE("Returning %d\n", ret
);
961 /*************************************************************************
962 * SQLGetDiagField [ODBC32.035]
964 SQLRETURN WINAPI
SQLGetDiagField(SQLSMALLINT HandleType
, SQLHANDLE Handle
, SQLSMALLINT RecNumber
,
965 SQLSMALLINT DiagIdentifier
, SQLPOINTER DiagInfo
, SQLSMALLINT BufferLength
,
966 SQLSMALLINT
*StringLength
)
968 struct SQLGetDiagField_params params
= { HandleType
, Handle
, RecNumber
, DiagIdentifier
, DiagInfo
,
969 BufferLength
, StringLength
};
972 TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d,"
973 " StringLength %p)\n", HandleType
, Handle
, RecNumber
, DiagIdentifier
, DiagInfo
, BufferLength
, StringLength
);
975 ret
= ODBC_CALL( SQLGetDiagField
, ¶ms
);
976 TRACE("Returning %d\n", ret
);
980 /*************************************************************************
981 * SQLGetDiagRec [ODBC32.036]
983 SQLRETURN WINAPI
SQLGetDiagRec(SQLSMALLINT HandleType
, SQLHANDLE Handle
, SQLSMALLINT RecNumber
,
984 SQLCHAR
*Sqlstate
, SQLINTEGER
*NativeError
, SQLCHAR
*MessageText
,
985 SQLSMALLINT BufferLength
, SQLSMALLINT
*TextLength
)
987 struct SQLGetDiagRec_params params
= { HandleType
, Handle
, RecNumber
, Sqlstate
, NativeError
,
988 MessageText
, BufferLength
, TextLength
};
991 TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d,"
992 " TextLength %p)\n", HandleType
, Handle
, RecNumber
, Sqlstate
, NativeError
, MessageText
, BufferLength
,
995 ret
= ODBC_CALL( SQLGetDiagRec
, ¶ms
);
996 TRACE("Returning %d\n", ret
);
1000 /*************************************************************************
1001 * SQLGetEnvAttr [ODBC32.037]
1003 SQLRETURN WINAPI
SQLGetEnvAttr(SQLHENV EnvironmentHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
1004 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
1006 struct SQLGetEnvAttr_params params
= { EnvironmentHandle
, Attribute
, Value
, BufferLength
, StringLength
};
1009 TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n",
1010 EnvironmentHandle
, Attribute
, Value
, BufferLength
, StringLength
);
1012 ret
= ODBC_CALL( SQLGetEnvAttr
, ¶ms
);
1013 TRACE("Returning %d\n", ret
);
1017 /*************************************************************************
1018 * SQLGetFunctions [ODBC32.044]
1020 SQLRETURN WINAPI
SQLGetFunctions(SQLHDBC ConnectionHandle
, SQLUSMALLINT FunctionId
, SQLUSMALLINT
*Supported
)
1022 struct SQLGetFunctions_params params
= { ConnectionHandle
, FunctionId
, Supported
};
1025 TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle
, FunctionId
, Supported
);
1027 ret
= ODBC_CALL( SQLGetFunctions
, ¶ms
);
1028 TRACE("Returning %d\n", ret
);
1032 /*************************************************************************
1033 * SQLGetInfo [ODBC32.045]
1035 SQLRETURN WINAPI
SQLGetInfo(SQLHDBC ConnectionHandle
, SQLUSMALLINT InfoType
, SQLPOINTER InfoValue
,
1036 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
)
1038 struct SQLGetInfo_params params
= { ConnectionHandle
, InfoType
, InfoValue
, BufferLength
, StringLength
};
1041 TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle
,
1042 InfoType
, InfoValue
, BufferLength
, StringLength
);
1046 WARN("Unexpected NULL InfoValue address\n");
1050 ret
= ODBC_CALL( SQLGetInfo
, ¶ms
);
1051 TRACE("Returning %d\n", ret
);
1055 /*************************************************************************
1056 * SQLGetStmtAttr [ODBC32.038]
1058 SQLRETURN WINAPI
SQLGetStmtAttr(SQLHSTMT StatementHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
1059 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
1061 struct SQLGetStmtAttr_params params
= { StatementHandle
, Attribute
, Value
, BufferLength
, StringLength
};
1064 TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle
,
1065 Attribute
, Value
, BufferLength
, StringLength
);
1069 WARN("Unexpected NULL Value return address\n");
1073 ret
= ODBC_CALL( SQLGetStmtAttr
, ¶ms
);
1074 TRACE("Returning %d\n", ret
);
1078 /*************************************************************************
1079 * SQLGetStmtOption [ODBC32.046]
1081 SQLRETURN WINAPI
SQLGetStmtOption(SQLHSTMT StatementHandle
, SQLUSMALLINT Option
, SQLPOINTER Value
)
1083 struct SQLGetStmtOption_params params
= { StatementHandle
, Option
, Value
};
1086 TRACE("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle
, Option
, Value
);
1088 ret
= ODBC_CALL( SQLGetStmtOption
, ¶ms
);
1089 TRACE("Returning %d\n", ret
);
1093 /*************************************************************************
1094 * SQLGetTypeInfo [ODBC32.047]
1096 SQLRETURN WINAPI
SQLGetTypeInfo(SQLHSTMT StatementHandle
, SQLSMALLINT DataType
)
1098 struct SQLGetTypeInfo_params params
= { StatementHandle
, DataType
};
1101 TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle
, DataType
);
1103 ret
= ODBC_CALL( SQLGetTypeInfo
, ¶ms
);
1104 TRACE("Returning %d\n", ret
);
1108 /*************************************************************************
1109 * SQLNumResultCols [ODBC32.018]
1111 SQLRETURN WINAPI
SQLNumResultCols(SQLHSTMT StatementHandle
, SQLSMALLINT
*ColumnCount
)
1113 struct SQLNumResultCols_params params
= { StatementHandle
, ColumnCount
};
1116 TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle
, ColumnCount
);
1118 ret
= ODBC_CALL( SQLNumResultCols
, ¶ms
);
1119 TRACE("Returning %d ColumnCount %d\n", ret
, *ColumnCount
);
1123 /*************************************************************************
1124 * SQLParamData [ODBC32.048]
1126 SQLRETURN WINAPI
SQLParamData(SQLHSTMT StatementHandle
, SQLPOINTER
*Value
)
1128 struct SQLParamData_params params
= { StatementHandle
, Value
};
1131 TRACE("(StatementHandle %p, Value %p)\n", StatementHandle
, Value
);
1133 ret
= ODBC_CALL( SQLParamData
, ¶ms
);
1134 TRACE("Returning %d\n", ret
);
1138 /*************************************************************************
1139 * SQLPrepare [ODBC32.019]
1141 SQLRETURN WINAPI
SQLPrepare(SQLHSTMT StatementHandle
, SQLCHAR
*StatementText
, SQLINTEGER TextLength
)
1143 struct SQLPrepare_params params
= { StatementHandle
, StatementText
, TextLength
};
1146 TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle
,
1147 debugstr_an((const char *)StatementText
, TextLength
), TextLength
);
1149 ret
= ODBC_CALL( SQLPrepare
, ¶ms
);
1150 TRACE("Returning %d\n", ret
);
1154 /*************************************************************************
1155 * SQLPutData [ODBC32.049]
1157 SQLRETURN WINAPI
SQLPutData(SQLHSTMT StatementHandle
, SQLPOINTER Data
, SQLLEN StrLen_or_Ind
)
1159 struct SQLPutData_params params
= { StatementHandle
, Data
, StrLen_or_Ind
};
1162 TRACE("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle
, Data
, debugstr_sqllen(StrLen_or_Ind
));
1164 ret
= ODBC_CALL( SQLPutData
, ¶ms
);
1165 TRACE("Returning %d\n", ret
);
1169 /*************************************************************************
1170 * SQLRowCount [ODBC32.020]
1172 SQLRETURN WINAPI
SQLRowCount(SQLHSTMT StatementHandle
, SQLLEN
*RowCount
)
1174 struct SQLRowCount_params params
= { StatementHandle
, RowCount
};
1177 TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle
, RowCount
);
1179 ret
= ODBC_CALL( SQLRowCount
, ¶ms
);
1180 if (ret
== SQL_SUCCESS
&& RowCount
) TRACE(" RowCount %s\n", debugstr_sqllen(*RowCount
));
1181 TRACE("Returning %d\n", ret
);
1185 /*************************************************************************
1186 * SQLSetConnectAttr [ODBC32.039]
1188 SQLRETURN WINAPI
SQLSetConnectAttr(SQLHDBC ConnectionHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
1189 SQLINTEGER StringLength
)
1191 struct SQLSetConnectAttr_params params
= { ConnectionHandle
, Attribute
, Value
, StringLength
};
1194 TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle
, Attribute
, Value
,
1197 ret
= ODBC_CALL( SQLSetConnectAttr
, ¶ms
);
1198 TRACE("Returning %d\n", ret
);
1202 /*************************************************************************
1203 * SQLSetConnectOption [ODBC32.050]
1205 SQLRETURN WINAPI
SQLSetConnectOption(SQLHDBC ConnectionHandle
, SQLUSMALLINT Option
, SQLULEN Value
)
1207 struct SQLSetConnectOption_params params
= { ConnectionHandle
, Option
, Value
};
1210 TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle
, Option
, debugstr_sqlulen(Value
));
1212 ret
= ODBC_CALL( SQLSetConnectOption
, ¶ms
);
1213 TRACE("Returning %d\n", ret
);
1217 /*************************************************************************
1218 * SQLSetCursorName [ODBC32.021]
1220 SQLRETURN WINAPI
SQLSetCursorName(SQLHSTMT StatementHandle
, SQLCHAR
*CursorName
, SQLSMALLINT NameLength
)
1222 struct SQLSetCursorName_params params
= { StatementHandle
, CursorName
, NameLength
};
1225 TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle
,
1226 debugstr_an((const char *)CursorName
, NameLength
), NameLength
);
1228 ret
= ODBC_CALL( SQLSetCursorName
, ¶ms
);
1229 TRACE("Returning %d\n", ret
);
1233 /*************************************************************************
1234 * SQLSetDescField [ODBC32.073]
1236 SQLRETURN WINAPI
SQLSetDescField(SQLHDESC DescriptorHandle
, SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
1237 SQLPOINTER Value
, SQLINTEGER BufferLength
)
1239 struct SQLSetDescField_params params
= { DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
, BufferLength
};
1242 TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle
,
1243 RecNumber
, FieldIdentifier
, Value
, BufferLength
);
1245 ret
= ODBC_CALL( SQLSetDescField
, ¶ms
);
1246 TRACE("Returning %d\n", ret
);
1250 /*************************************************************************
1251 * SQLSetDescRec [ODBC32.074]
1253 SQLRETURN WINAPI
SQLSetDescRec(SQLHDESC DescriptorHandle
, SQLSMALLINT RecNumber
, SQLSMALLINT Type
,
1254 SQLSMALLINT SubType
, SQLLEN Length
, SQLSMALLINT Precision
, SQLSMALLINT Scale
,
1255 SQLPOINTER Data
, SQLLEN
*StringLength
, SQLLEN
*Indicator
)
1257 struct SQLSetDescRec_params params
= { DescriptorHandle
, RecNumber
, Type
, SubType
, Length
, Precision
, Scale
, Data
, StringLength
, Indicator
};
1260 TRACE("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p,"
1261 " StringLength %p, Indicator %p)\n", DescriptorHandle
, RecNumber
, Type
, SubType
, debugstr_sqllen(Length
),
1262 Precision
, Scale
, Data
, StringLength
, Indicator
);
1264 ret
= ODBC_CALL( SQLSetDescRec
, ¶ms
);
1265 TRACE("Returning %d\n", ret
);
1269 /*************************************************************************
1270 * SQLSetEnvAttr [ODBC32.075]
1272 SQLRETURN WINAPI
SQLSetEnvAttr(SQLHENV EnvironmentHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
1273 SQLINTEGER StringLength
)
1275 struct SQLSetEnvAttr_params params
= { EnvironmentHandle
, Attribute
, Value
, StringLength
};
1278 TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle
, Attribute
, Value
,
1281 ret
= ODBC_CALL( SQLSetEnvAttr
, ¶ms
);
1282 TRACE("Returning %d\n", ret
);
1286 /*************************************************************************
1287 * SQLSetParam [ODBC32.022]
1289 SQLRETURN WINAPI
SQLSetParam(SQLHSTMT StatementHandle
, SQLUSMALLINT ParameterNumber
, SQLSMALLINT ValueType
,
1290 SQLSMALLINT ParameterType
, SQLULEN LengthPrecision
, SQLSMALLINT ParameterScale
,
1291 SQLPOINTER ParameterValue
, SQLLEN
*StrLen_or_Ind
)
1293 struct SQLSetParam_params params
= { StatementHandle
, ParameterNumber
, ValueType
, ParameterType
,
1294 LengthPrecision
, ParameterScale
, ParameterValue
, StrLen_or_Ind
};
1297 TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s,"
1298 " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle
, ParameterNumber
, ValueType
,
1299 ParameterType
, debugstr_sqlulen(LengthPrecision
), ParameterScale
, ParameterValue
, StrLen_or_Ind
);
1301 ret
= ODBC_CALL( SQLSetParam
, ¶ms
);
1302 TRACE("Returning %d\n", ret
);
1306 /*************************************************************************
1307 * SQLSetStmtAttr [ODBC32.076]
1309 SQLRETURN WINAPI
SQLSetStmtAttr(SQLHSTMT StatementHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
1310 SQLINTEGER StringLength
)
1312 struct SQLSetStmtAttr_params params
= { StatementHandle
, Attribute
, Value
, StringLength
};
1315 TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle
, Attribute
, Value
,
1318 ret
= ODBC_CALL( SQLSetStmtAttr
, ¶ms
);
1319 TRACE("Returning %d\n", ret
);
1323 /*************************************************************************
1324 * SQLSetStmtOption [ODBC32.051]
1326 SQLRETURN WINAPI
SQLSetStmtOption(SQLHSTMT StatementHandle
, SQLUSMALLINT Option
, SQLULEN Value
)
1328 struct SQLSetStmtOption_params params
= { StatementHandle
, Option
, Value
};
1331 TRACE("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle
, Option
, debugstr_sqlulen(Value
));
1333 ret
= ODBC_CALL( SQLSetStmtOption
, ¶ms
);
1334 TRACE("Returning %d\n", ret
);
1338 /*************************************************************************
1339 * SQLSpecialColumns [ODBC32.052]
1341 SQLRETURN WINAPI
SQLSpecialColumns(SQLHSTMT StatementHandle
, SQLUSMALLINT IdentifierType
, SQLCHAR
*CatalogName
,
1342 SQLSMALLINT NameLength1
, SQLCHAR
*SchemaName
, SQLSMALLINT NameLength2
,
1343 SQLCHAR
*TableName
, SQLSMALLINT NameLength3
, SQLUSMALLINT Scope
,
1344 SQLUSMALLINT Nullable
)
1346 struct SQLSpecialColumns_params params
= { StatementHandle
, IdentifierType
, CatalogName
, NameLength1
,
1347 SchemaName
, NameLength2
, TableName
, NameLength3
, Scope
, Nullable
};
1350 TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d,"
1351 " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle
, IdentifierType
,
1352 debugstr_an((const char *)CatalogName
, NameLength1
), NameLength1
,
1353 debugstr_an((const char *)SchemaName
, NameLength2
), NameLength2
,
1354 debugstr_an((const char *)TableName
, NameLength3
), NameLength3
, Scope
, Nullable
);
1356 ret
= ODBC_CALL( SQLSpecialColumns
, ¶ms
);
1357 TRACE("Returning %d\n", ret
);
1361 /*************************************************************************
1362 * SQLStatistics [ODBC32.053]
1364 SQLRETURN WINAPI
SQLStatistics(SQLHSTMT StatementHandle
, SQLCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
1365 SQLCHAR
*SchemaName
, SQLSMALLINT NameLength2
, SQLCHAR
*TableName
,
1366 SQLSMALLINT NameLength3
, SQLUSMALLINT Unique
, SQLUSMALLINT Reserved
)
1368 struct SQLStatistics_params params
= { StatementHandle
, CatalogName
, NameLength1
, SchemaName
,
1369 NameLength2
, TableName
, NameLength3
, Unique
, Reserved
};
1372 TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s"
1373 " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle
,
1374 debugstr_an((const char *)CatalogName
, NameLength1
), NameLength1
,
1375 debugstr_an((const char *)SchemaName
, NameLength2
), NameLength2
,
1376 debugstr_an((const char *)TableName
, NameLength3
), NameLength3
, Unique
, Reserved
);
1378 ret
= ODBC_CALL( SQLStatistics
, ¶ms
);
1379 TRACE("Returning %d\n", ret
);
1383 /*************************************************************************
1384 * SQLTables [ODBC32.054]
1386 SQLRETURN WINAPI
SQLTables(SQLHSTMT StatementHandle
, SQLCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
1387 SQLCHAR
*SchemaName
, SQLSMALLINT NameLength2
, SQLCHAR
*TableName
,
1388 SQLSMALLINT NameLength3
, SQLCHAR
*TableType
, SQLSMALLINT NameLength4
)
1390 struct SQLTables_params params
= { StatementHandle
, CatalogName
, NameLength1
, SchemaName
, NameLength2
,
1391 TableName
, NameLength3
, TableType
, NameLength4
};
1394 TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
1395 " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle
,
1396 debugstr_an((const char *)CatalogName
, NameLength1
), NameLength1
,
1397 debugstr_an((const char *)SchemaName
, NameLength2
), NameLength2
,
1398 debugstr_an((const char *)TableName
, NameLength3
), NameLength3
,
1399 debugstr_an((const char *)TableType
, NameLength4
), NameLength4
);
1401 ret
= ODBC_CALL( SQLTables
, ¶ms
);
1402 TRACE("Returning %d\n", ret
);
1406 /*************************************************************************
1407 * SQLTransact [ODBC32.023]
1409 SQLRETURN WINAPI
SQLTransact(SQLHENV EnvironmentHandle
, SQLHDBC ConnectionHandle
, SQLUSMALLINT CompletionType
)
1411 struct SQLTransact_params params
= { EnvironmentHandle
, ConnectionHandle
, CompletionType
};
1414 TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle
, ConnectionHandle
,
1417 ret
= ODBC_CALL( SQLTransact
, ¶ms
);
1418 TRACE("Returning %d\n", ret
);
1422 /*************************************************************************
1423 * SQLBrowseConnect [ODBC32.055]
1425 SQLRETURN WINAPI
SQLBrowseConnect(SQLHDBC hdbc
, SQLCHAR
*szConnStrIn
, SQLSMALLINT cbConnStrIn
,
1426 SQLCHAR
*szConnStrOut
, SQLSMALLINT cbConnStrOutMax
,
1427 SQLSMALLINT
*pcbConnStrOut
)
1429 struct SQLBrowseConnect_params params
= { hdbc
, szConnStrIn
, cbConnStrIn
, szConnStrOut
,
1430 cbConnStrOutMax
, pcbConnStrOut
};
1433 TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n",
1434 hdbc
, debugstr_an((const char *)szConnStrIn
, cbConnStrIn
), cbConnStrIn
, szConnStrOut
, cbConnStrOutMax
,
1437 ret
= ODBC_CALL( SQLBrowseConnect
, ¶ms
);
1438 TRACE("Returning %d\n", ret
);
1442 /*************************************************************************
1443 * SQLBulkOperations [ODBC32.078]
1445 SQLRETURN WINAPI
SQLBulkOperations(SQLHSTMT StatementHandle
, SQLSMALLINT Operation
)
1447 struct SQLBulkOperations_params params
= { StatementHandle
, Operation
};
1450 TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle
, Operation
);
1452 ret
= ODBC_CALL( SQLBulkOperations
, ¶ms
);
1453 TRACE("Returning %d\n", ret
);
1457 /*************************************************************************
1458 * SQLColAttributes [ODBC32.006]
1460 SQLRETURN WINAPI
SQLColAttributes(SQLHSTMT hstmt
, SQLUSMALLINT icol
, SQLUSMALLINT fDescType
,
1461 SQLPOINTER rgbDesc
, SQLSMALLINT cbDescMax
, SQLSMALLINT
*pcbDesc
,
1464 struct SQLColAttributes_params params
= { hstmt
, icol
, fDescType
, rgbDesc
, cbDescMax
, pcbDesc
, pfDesc
};
1467 TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt
, icol
,
1468 fDescType
, rgbDesc
, cbDescMax
, pcbDesc
, pfDesc
);
1470 ret
= ODBC_CALL( SQLColAttributes
, ¶ms
);
1471 TRACE("Returning %d\n", ret
);
1475 /*************************************************************************
1476 * SQLColumnPrivileges [ODBC32.056]
1478 SQLRETURN WINAPI
SQLColumnPrivileges(SQLHSTMT hstmt
, SQLCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
1479 SQLCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLCHAR
*szTableName
,
1480 SQLSMALLINT cbTableName
, SQLCHAR
*szColumnName
, SQLSMALLINT cbColumnName
)
1482 struct SQLColumnPrivileges_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
1483 cbSchemaName
, szTableName
, cbTableName
, szColumnName
, cbColumnName
};
1486 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
1487 " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt
,
1488 debugstr_an((const char *)szCatalogName
, cbCatalogName
), cbCatalogName
,
1489 debugstr_an((const char *)szSchemaName
, cbSchemaName
), cbSchemaName
,
1490 debugstr_an((const char *)szTableName
, cbTableName
), cbTableName
,
1491 debugstr_an((const char *)szColumnName
, cbColumnName
), cbColumnName
);
1493 ret
= ODBC_CALL( SQLColumnPrivileges
, ¶ms
);
1494 TRACE("Returning %d\n", ret
);
1498 /*************************************************************************
1499 * SQLDescribeParam [ODBC32.058]
1501 SQLRETURN WINAPI
SQLDescribeParam(SQLHSTMT hstmt
, SQLUSMALLINT ipar
, SQLSMALLINT
*pfSqlType
,
1502 SQLULEN
*pcbParamDef
, SQLSMALLINT
*pibScale
, SQLSMALLINT
*pfNullable
)
1504 struct SQLDescribeParam_params params
= { hstmt
, ipar
, pfSqlType
, pcbParamDef
, pibScale
, pfNullable
};
1507 TRACE("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt
, ipar
,
1508 pfSqlType
, pcbParamDef
, pibScale
, pfNullable
);
1510 ret
= ODBC_CALL( SQLDescribeParam
, ¶ms
);
1511 TRACE("Returning %d\n", ret
);
1515 /*************************************************************************
1516 * SQLExtendedFetch [ODBC32.059]
1518 SQLRETURN WINAPI
SQLExtendedFetch(SQLHSTMT hstmt
, SQLUSMALLINT fFetchType
, SQLLEN irow
, SQLULEN
*pcrow
,
1519 SQLUSMALLINT
*rgfRowStatus
)
1521 struct SQLExtendedFetch_params params
= { hstmt
, fFetchType
, irow
, pcrow
, rgfRowStatus
};
1524 TRACE("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt
, fFetchType
, debugstr_sqllen(irow
),
1525 pcrow
, rgfRowStatus
);
1527 ret
= ODBC_CALL( SQLExtendedFetch
, ¶ms
);
1528 TRACE("Returning %d\n", ret
);
1532 /*************************************************************************
1533 * SQLForeignKeys [ODBC32.060]
1535 SQLRETURN WINAPI
SQLForeignKeys(SQLHSTMT hstmt
, SQLCHAR
*szPkCatalogName
, SQLSMALLINT cbPkCatalogName
,
1536 SQLCHAR
*szPkSchemaName
, SQLSMALLINT cbPkSchemaName
, SQLCHAR
*szPkTableName
,
1537 SQLSMALLINT cbPkTableName
, SQLCHAR
*szFkCatalogName
,
1538 SQLSMALLINT cbFkCatalogName
, SQLCHAR
*szFkSchemaName
,
1539 SQLSMALLINT cbFkSchemaName
, SQLCHAR
*szFkTableName
, SQLSMALLINT cbFkTableName
)
1541 struct SQLForeignKeys_params params
= { hstmt
, szPkCatalogName
, cbPkCatalogName
, szPkSchemaName
,
1542 cbPkSchemaName
, szPkTableName
, cbPkTableName
, szFkCatalogName
,
1543 cbFkCatalogName
, szFkSchemaName
, cbFkSchemaName
,
1544 szFkTableName
, cbFkTableName
};
1547 TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d,"
1548 " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s,"
1549 " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt
,
1550 debugstr_an((const char *)szPkCatalogName
, cbPkCatalogName
), cbPkCatalogName
,
1551 debugstr_an((const char *)szPkSchemaName
, cbPkSchemaName
), cbPkSchemaName
,
1552 debugstr_an((const char *)szPkTableName
, cbPkTableName
), cbPkTableName
,
1553 debugstr_an((const char *)szFkCatalogName
, cbFkCatalogName
), cbFkCatalogName
,
1554 debugstr_an((const char *)szFkSchemaName
, cbFkSchemaName
), cbFkSchemaName
,
1555 debugstr_an((const char *)szFkTableName
, cbFkTableName
), cbFkTableName
);
1557 ret
= ODBC_CALL( SQLForeignKeys
, ¶ms
);
1558 TRACE("Returning %d\n", ret
);
1562 /*************************************************************************
1563 * SQLMoreResults [ODBC32.061]
1565 SQLRETURN WINAPI
SQLMoreResults(SQLHSTMT StatementHandle
)
1567 struct SQLMoreResults_params params
= { StatementHandle
};
1570 TRACE("(%p)\n", StatementHandle
);
1572 ret
= ODBC_CALL( SQLMoreResults
, ¶ms
);
1573 TRACE("Returning %d\n", ret
);
1577 /*************************************************************************
1578 * SQLNativeSql [ODBC32.062]
1580 SQLRETURN WINAPI
SQLNativeSql(SQLHDBC hdbc
, SQLCHAR
*szSqlStrIn
, SQLINTEGER cbSqlStrIn
, SQLCHAR
*szSqlStr
,
1581 SQLINTEGER cbSqlStrMax
, SQLINTEGER
*pcbSqlStr
)
1583 struct SQLNativeSql_params params
= { hdbc
, szSqlStrIn
, cbSqlStrIn
, szSqlStr
, cbSqlStrMax
, pcbSqlStr
};
1586 TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc
,
1587 debugstr_an((const char *)szSqlStrIn
, cbSqlStrIn
), cbSqlStrIn
, szSqlStr
, cbSqlStrMax
, pcbSqlStr
);
1589 ret
= ODBC_CALL( SQLNativeSql
, ¶ms
);
1590 TRACE("Returning %d\n", ret
);
1594 /*************************************************************************
1595 * SQLNumParams [ODBC32.063]
1597 SQLRETURN WINAPI
SQLNumParams(SQLHSTMT hstmt
, SQLSMALLINT
*pcpar
)
1599 struct SQLNumParams_params params
= { hstmt
, pcpar
};
1602 TRACE("(hstmt %p, pcpar %p)\n", hstmt
, pcpar
);
1604 ret
= ODBC_CALL( SQLNumParams
, ¶ms
);
1605 TRACE("Returning %d\n", ret
);
1609 /*************************************************************************
1610 * SQLParamOptions [ODBC32.064]
1612 SQLRETURN WINAPI
SQLParamOptions(SQLHSTMT hstmt
, SQLULEN crow
, SQLULEN
*pirow
)
1614 struct SQLParamOptions_params params
= { hstmt
, crow
, pirow
};
1617 TRACE("(hstmt %p, crow %s, pirow %p)\n", hstmt
, debugstr_sqlulen(crow
), pirow
);
1619 ret
= ODBC_CALL( SQLParamOptions
, ¶ms
);
1620 TRACE("Returning %d\n", ret
);
1624 /*************************************************************************
1625 * SQLPrimaryKeys [ODBC32.065]
1627 SQLRETURN WINAPI
SQLPrimaryKeys(SQLHSTMT hstmt
, SQLCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
1628 SQLCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLCHAR
*szTableName
,
1629 SQLSMALLINT cbTableName
)
1631 struct SQLPrimaryKeys_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
1632 cbSchemaName
, szTableName
, cbTableName
};
1635 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
1636 " cbTableName %d)\n", hstmt
,
1637 debugstr_an((const char *)szCatalogName
, cbCatalogName
), cbCatalogName
,
1638 debugstr_an((const char *)szSchemaName
, cbSchemaName
), cbSchemaName
,
1639 debugstr_an((const char *)szTableName
, cbTableName
), cbTableName
);
1641 ret
= ODBC_CALL( SQLPrimaryKeys
, ¶ms
);
1642 TRACE("Returning %d\n", ret
);
1646 /*************************************************************************
1647 * SQLProcedureColumns [ODBC32.066]
1649 SQLRETURN WINAPI
SQLProcedureColumns(SQLHSTMT hstmt
, SQLCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
1650 SQLCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLCHAR
*szProcName
,
1651 SQLSMALLINT cbProcName
, SQLCHAR
*szColumnName
, SQLSMALLINT cbColumnName
)
1653 struct SQLProcedureColumns_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
1654 cbSchemaName
, szProcName
, cbProcName
,
1655 szColumnName
, cbColumnName
};
1658 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
1659 " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt
,
1660 debugstr_an((const char *)szCatalogName
, cbCatalogName
), cbCatalogName
,
1661 debugstr_an((const char *)szSchemaName
, cbSchemaName
), cbSchemaName
,
1662 debugstr_an((const char *)szProcName
, cbProcName
), cbProcName
,
1663 debugstr_an((const char *)szColumnName
, cbColumnName
), cbColumnName
);
1665 ret
= ODBC_CALL( SQLProcedureColumns
, ¶ms
);
1666 TRACE("Returning %d\n", ret
);
1670 /*************************************************************************
1671 * SQLProcedures [ODBC32.067]
1673 SQLRETURN WINAPI
SQLProcedures(SQLHSTMT hstmt
, SQLCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
1674 SQLCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLCHAR
*szProcName
,
1675 SQLSMALLINT cbProcName
)
1677 struct SQLProcedures_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
1678 cbSchemaName
, szProcName
, cbProcName
};
1681 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
1682 " cbProcName %d)\n", hstmt
,
1683 debugstr_an((const char *)szCatalogName
, cbCatalogName
), cbCatalogName
,
1684 debugstr_an((const char *)szSchemaName
, cbSchemaName
), cbSchemaName
,
1685 debugstr_an((const char *)szProcName
, cbProcName
), cbProcName
);
1687 ret
= ODBC_CALL( SQLProcedures
, ¶ms
);
1688 TRACE("Returning %d\n", ret
);
1692 /*************************************************************************
1693 * SQLSetPos [ODBC32.068]
1695 SQLRETURN WINAPI
SQLSetPos(SQLHSTMT hstmt
, SQLSETPOSIROW irow
, SQLUSMALLINT fOption
, SQLUSMALLINT fLock
)
1697 struct SQLSetPos_params params
= { hstmt
, irow
, fOption
, fLock
};
1700 TRACE("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt
, debugstr_sqlulen(irow
), fOption
, fLock
);
1702 ret
= ODBC_CALL( SQLSetPos
, ¶ms
);
1703 TRACE("Returning %d\n", ret
);
1707 /*************************************************************************
1708 * SQLTablePrivileges [ODBC32.070]
1710 SQLRETURN WINAPI
SQLTablePrivileges(SQLHSTMT hstmt
, SQLCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
1711 SQLCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLCHAR
*szTableName
,
1712 SQLSMALLINT cbTableName
)
1714 struct SQLTablePrivileges_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
1715 cbSchemaName
, szTableName
, cbTableName
};
1718 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
1719 " cbTableName %d)\n", hstmt
,
1720 debugstr_an((const char *)szCatalogName
, cbCatalogName
), cbCatalogName
,
1721 debugstr_an((const char *)szSchemaName
, cbSchemaName
), cbSchemaName
,
1722 debugstr_an((const char *)szTableName
, cbTableName
), cbTableName
);
1724 ret
= ODBC_CALL( SQLTablePrivileges
, ¶ms
);
1725 TRACE("Returning %d\n", ret
);
1729 /*************************************************************************
1730 * SQLDrivers [ODBC32.071]
1732 SQLRETURN WINAPI
SQLDrivers(SQLHENV EnvironmentHandle
, SQLUSMALLINT fDirection
, SQLCHAR
*szDriverDesc
,
1733 SQLSMALLINT cbDriverDescMax
, SQLSMALLINT
*pcbDriverDesc
,
1734 SQLCHAR
*szDriverAttributes
, SQLSMALLINT cbDriverAttrMax
,
1735 SQLSMALLINT
*pcbDriverAttr
)
1737 struct SQLDrivers_params params
= { EnvironmentHandle
, fDirection
, szDriverDesc
, cbDriverDescMax
,
1738 pcbDriverDesc
, szDriverAttributes
, cbDriverAttrMax
, pcbDriverAttr
};
1741 TRACE("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p,"
1742 " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle
, fDirection
,
1743 szDriverDesc
, cbDriverDescMax
, pcbDriverDesc
, szDriverAttributes
, cbDriverAttrMax
, pcbDriverAttr
);
1745 ret
= ODBC_CALL( SQLDrivers
, ¶ms
);
1747 if (ret
== SQL_NO_DATA
&& fDirection
== SQL_FETCH_FIRST
)
1748 ERR_(winediag
)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n");
1750 TRACE("Returning %d\n", ret
);
1754 /*************************************************************************
1755 * SQLBindParameter [ODBC32.072]
1757 SQLRETURN WINAPI
SQLBindParameter(SQLHSTMT hstmt
, SQLUSMALLINT ipar
, SQLSMALLINT fParamType
,
1758 SQLSMALLINT fCType
, SQLSMALLINT fSqlType
, SQLULEN cbColDef
,
1759 SQLSMALLINT ibScale
, SQLPOINTER rgbValue
, SQLLEN cbValueMax
,
1762 struct SQLBindParameter_params params
= { hstmt
, ipar
, fParamType
, fCType
, fSqlType
, cbColDef
,
1763 ibScale
, rgbValue
, cbValueMax
, pcbValue
};
1766 TRACE("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p,"
1767 " cbValueMax %s, pcbValue %p)\n", hstmt
, ipar
, fParamType
, fCType
, fSqlType
, debugstr_sqlulen(cbColDef
),
1768 ibScale
, rgbValue
, debugstr_sqllen(cbValueMax
), pcbValue
);
1770 ret
= ODBC_CALL( SQLBindParameter
, ¶ms
);
1771 TRACE("Returning %d\n", ret
);
1775 /*************************************************************************
1776 * SQLDriverConnect [ODBC32.041]
1778 SQLRETURN WINAPI
SQLDriverConnect(SQLHDBC hdbc
, SQLHWND hwnd
, SQLCHAR
*ConnectionString
, SQLSMALLINT Length
,
1779 SQLCHAR
*conn_str_out
, SQLSMALLINT conn_str_out_max
,
1780 SQLSMALLINT
*ptr_conn_str_out
, SQLUSMALLINT driver_completion
)
1782 struct SQLDriverConnect_params params
= { hdbc
, hwnd
, ConnectionString
, Length
, conn_str_out
,
1783 conn_str_out_max
, ptr_conn_str_out
, driver_completion
};
1786 TRACE("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d,"
1787 " ptr_conn_str_out %p, driver_completion %d)\n", hdbc
, hwnd
,
1788 debugstr_an((const char *)ConnectionString
, Length
), Length
, conn_str_out
, conn_str_out_max
,
1789 ptr_conn_str_out
, driver_completion
);
1791 ret
= ODBC_CALL( SQLDriverConnect
, ¶ms
);
1792 TRACE("Returning %d\n", ret
);
1796 /*************************************************************************
1797 * SQLSetScrollOptions [ODBC32.069]
1799 SQLRETURN WINAPI
SQLSetScrollOptions(SQLHSTMT statement_handle
, SQLUSMALLINT f_concurrency
, SQLLEN crow_keyset
,
1800 SQLUSMALLINT crow_rowset
)
1802 struct SQLSetScrollOptions_params params
= { statement_handle
, f_concurrency
, crow_keyset
, crow_rowset
};
1805 TRACE("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_handle
,
1806 f_concurrency
, debugstr_sqllen(crow_keyset
), crow_rowset
);
1808 ret
= ODBC_CALL( SQLSetScrollOptions
, ¶ms
);
1809 TRACE("Returning %d\n", ret
);
1813 static BOOL
SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType
)
1815 static const SQLUSMALLINT attrList
[] =
1817 SQL_COLUMN_OWNER_NAME
,
1818 SQL_COLUMN_QUALIFIER_NAME
,
1821 SQL_COLUMN_TABLE_NAME
,
1822 SQL_COLUMN_TYPE_NAME
,
1823 SQL_DESC_BASE_COLUMN_NAME
,
1824 SQL_DESC_BASE_TABLE_NAME
,
1825 SQL_DESC_CATALOG_NAME
,
1827 SQL_DESC_LITERAL_PREFIX
,
1828 SQL_DESC_LITERAL_SUFFIX
,
1829 SQL_DESC_LOCAL_TYPE_NAME
,
1831 SQL_DESC_SCHEMA_NAME
,
1832 SQL_DESC_TABLE_NAME
,
1837 for (i
= 0; i
< ARRAY_SIZE(attrList
); i
++) {
1838 if (attrList
[i
] == fDescType
) return TRUE
;
1843 /*************************************************************************
1844 * SQLColAttributesW [ODBC32.106]
1846 SQLRETURN WINAPI
SQLColAttributesW(SQLHSTMT hstmt
, SQLUSMALLINT icol
, SQLUSMALLINT fDescType
,
1847 SQLPOINTER rgbDesc
, SQLSMALLINT cbDescMax
, SQLSMALLINT
*pcbDesc
,
1850 struct SQLColAttributesW_params params
= { hstmt
, icol
, fDescType
, rgbDesc
, cbDescMax
, pcbDesc
, pfDesc
};
1853 TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt
, icol
,
1854 fDescType
, rgbDesc
, cbDescMax
, pcbDesc
, pfDesc
);
1856 ret
= ODBC_CALL( SQLColAttributesW
, ¶ms
);
1858 if (ret
== SQL_SUCCESS
&& SQLColAttributes_KnownStringAttribute(fDescType
) && rgbDesc
&& pcbDesc
&&
1859 *pcbDesc
!= lstrlenW(rgbDesc
) * 2)
1861 TRACE("CHEAT: resetting name length for ADO\n");
1862 *pcbDesc
= lstrlenW(rgbDesc
) * 2;
1865 TRACE("Returning %d\n", ret
);
1869 /*************************************************************************
1870 * SQLConnectW [ODBC32.107]
1872 SQLRETURN WINAPI
SQLConnectW(SQLHDBC ConnectionHandle
, WCHAR
*ServerName
, SQLSMALLINT NameLength1
,
1873 WCHAR
*UserName
, SQLSMALLINT NameLength2
, WCHAR
*Authentication
,
1874 SQLSMALLINT NameLength3
)
1876 struct SQLConnectW_params params
= { ConnectionHandle
, ServerName
, NameLength1
, UserName
, NameLength2
,
1877 Authentication
, NameLength3
};
1880 TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s,"
1881 " NameLength3 %d)\n", ConnectionHandle
, debugstr_wn(ServerName
, NameLength1
), NameLength1
,
1882 debugstr_wn(UserName
, NameLength2
), NameLength2
, debugstr_wn(Authentication
, NameLength3
), NameLength3
);
1884 ret
= ODBC_CALL( SQLConnectW
, ¶ms
);
1885 TRACE("Returning %d\n", ret
);
1889 /*************************************************************************
1890 * SQLDescribeColW [ODBC32.108]
1892 SQLRETURN WINAPI
SQLDescribeColW(SQLHSTMT StatementHandle
, SQLUSMALLINT ColumnNumber
, WCHAR
*ColumnName
,
1893 SQLSMALLINT BufferLength
, SQLSMALLINT
*NameLength
, SQLSMALLINT
*DataType
,
1894 SQLULEN
*ColumnSize
, SQLSMALLINT
*DecimalDigits
, SQLSMALLINT
*Nullable
)
1896 struct SQLDescribeColW_params params
= { StatementHandle
, ColumnNumber
, ColumnName
, BufferLength
,
1897 NameLength
, DataType
, ColumnSize
, DecimalDigits
, Nullable
};
1901 TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p,"
1902 " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle
, ColumnNumber
, ColumnName
,
1903 BufferLength
, NameLength
, DataType
, ColumnSize
, DecimalDigits
, Nullable
);
1905 if (!NameLength
) NameLength
= &dummy
; /* workaround for drivers that don't accept NULL NameLength */
1907 ret
= ODBC_CALL( SQLDescribeColW
, ¶ms
);
1910 if (ColumnName
&& NameLength
) TRACE("ColumnName %s\n", debugstr_wn(ColumnName
, *NameLength
));
1911 if (DataType
) TRACE("DataType %d\n", *DataType
);
1912 if (ColumnSize
) TRACE("ColumnSize %s\n", debugstr_sqlulen(*ColumnSize
));
1913 if (DecimalDigits
) TRACE("DecimalDigits %d\n", *DecimalDigits
);
1914 if (Nullable
) TRACE("Nullable %d\n", *Nullable
);
1917 TRACE("Returning %d\n", ret
);
1921 /*************************************************************************
1922 * SQLErrorW [ODBC32.110]
1924 SQLRETURN WINAPI
SQLErrorW(SQLHENV EnvironmentHandle
, SQLHDBC ConnectionHandle
, SQLHSTMT StatementHandle
,
1925 WCHAR
*Sqlstate
, SQLINTEGER
*NativeError
, WCHAR
*MessageText
,
1926 SQLSMALLINT BufferLength
, SQLSMALLINT
*TextLength
)
1928 struct SQLErrorW_params params
= { EnvironmentHandle
, ConnectionHandle
, StatementHandle
, Sqlstate
,
1929 NativeError
, MessageText
, BufferLength
, TextLength
};
1932 TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p,"
1933 " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle
, ConnectionHandle
,
1934 StatementHandle
, Sqlstate
, NativeError
, MessageText
, BufferLength
, TextLength
);
1936 ret
= ODBC_CALL( SQLErrorW
, ¶ms
);
1938 if (ret
== SQL_SUCCESS
)
1940 TRACE(" SQLState %s\n", debugstr_wn(Sqlstate
, 5));
1941 TRACE(" Error %d\n", *NativeError
);
1942 TRACE(" MessageText %s\n", debugstr_wn(MessageText
, *TextLength
));
1945 TRACE("Returning %d\n", ret
);
1949 /*************************************************************************
1950 * SQLExecDirectW [ODBC32.111]
1952 SQLRETURN WINAPI
SQLExecDirectW(SQLHSTMT StatementHandle
, WCHAR
*StatementText
, SQLINTEGER TextLength
)
1954 struct SQLExecDirectW_params params
= { StatementHandle
, StatementText
, TextLength
};
1957 TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle
,
1958 debugstr_wn(StatementText
, TextLength
), TextLength
);
1960 ret
= ODBC_CALL( SQLExecDirectW
, ¶ms
);
1961 TRACE("Returning %d\n", ret
);
1965 /*************************************************************************
1966 * SQLGetCursorNameW [ODBC32.117]
1968 SQLRETURN WINAPI
SQLGetCursorNameW(SQLHSTMT StatementHandle
, WCHAR
*CursorName
, SQLSMALLINT BufferLength
,
1969 SQLSMALLINT
*NameLength
)
1971 struct SQLGetCursorNameW_params params
= { StatementHandle
, CursorName
, BufferLength
, NameLength
};
1974 TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle
, CursorName
,
1975 BufferLength
, NameLength
);
1977 ret
= ODBC_CALL( SQLGetCursorNameW
, ¶ms
);
1978 TRACE("Returning %d\n", ret
);
1982 /*************************************************************************
1983 * SQLPrepareW [ODBC32.119]
1985 SQLRETURN WINAPI
SQLPrepareW(SQLHSTMT StatementHandle
, WCHAR
*StatementText
, SQLINTEGER TextLength
)
1987 struct SQLPrepareW_params params
= { StatementHandle
, StatementText
, TextLength
};
1990 TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle
,
1991 debugstr_wn(StatementText
, TextLength
), TextLength
);
1993 ret
= ODBC_CALL( SQLPrepareW
, ¶ms
);
1994 TRACE("Returning %d\n", ret
);
1998 /*************************************************************************
1999 * SQLSetCursorNameW [ODBC32.121]
2001 SQLRETURN WINAPI
SQLSetCursorNameW(SQLHSTMT StatementHandle
, WCHAR
*CursorName
, SQLSMALLINT NameLength
)
2003 struct SQLSetCursorNameW_params params
= { StatementHandle
, CursorName
, NameLength
};
2006 TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle
,
2007 debugstr_wn(CursorName
, NameLength
), NameLength
);
2009 ret
= ODBC_CALL( SQLSetCursorNameW
, ¶ms
);
2010 TRACE("Returning %d\n", ret
);
2014 /*************************************************************************
2015 * SQLColAttributeW [ODBC32.127]
2017 SQLRETURN WINAPI
SQLColAttributeW(SQLHSTMT StatementHandle
, SQLUSMALLINT ColumnNumber
,
2018 SQLUSMALLINT FieldIdentifier
, SQLPOINTER CharacterAttribute
,
2019 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
,
2020 SQLLEN
*NumericAttribute
)
2022 struct SQLColAttributeW_params params
= { StatementHandle
, ColumnNumber
, FieldIdentifier
,
2023 CharacterAttribute
, BufferLength
, StringLength
,
2027 TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d"
2028 " StringLength %p NumericAttribute %p\n", StatementHandle
, ColumnNumber
, FieldIdentifier
,
2029 CharacterAttribute
, BufferLength
, StringLength
, NumericAttribute
);
2031 ret
= ODBC_CALL( SQLColAttributeW
, ¶ms
);
2033 if (ret
== SQL_SUCCESS
&& CharacterAttribute
!= NULL
&& SQLColAttributes_KnownStringAttribute(FieldIdentifier
) &&
2034 StringLength
&& *StringLength
!= lstrlenW(CharacterAttribute
) * 2)
2036 TRACE("CHEAT: resetting name length for ADO\n");
2037 *StringLength
= lstrlenW(CharacterAttribute
) * 2;
2040 TRACE("Returning %d\n", ret
);
2044 /*************************************************************************
2045 * SQLGetConnectAttrW [ODBC32.132]
2047 SQLRETURN WINAPI
SQLGetConnectAttrW(SQLHDBC ConnectionHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
2048 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
2050 struct SQLGetConnectAttrW_params params
= { ConnectionHandle
, Attribute
, Value
,
2051 BufferLength
, StringLength
};
2054 TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle
,
2055 Attribute
, Value
, BufferLength
, StringLength
);
2057 ret
= ODBC_CALL( SQLGetConnectAttrW
, ¶ms
);
2058 TRACE("Returning %d\n", ret
);
2062 /*************************************************************************
2063 * SQLGetDescFieldW [ODBC32.133]
2065 SQLRETURN WINAPI
SQLGetDescFieldW(SQLHDESC DescriptorHandle
, SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
2066 SQLPOINTER Value
, SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
2068 struct SQLGetDescFieldW_params params
= { DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
,
2069 BufferLength
, StringLength
};
2072 TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n",
2073 DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
, BufferLength
, StringLength
);
2075 ret
= ODBC_CALL( SQLGetDescFieldW
, ¶ms
);
2076 TRACE("Returning %d\n", ret
);
2080 /*************************************************************************
2081 * SQLGetDescRecW [ODBC32.134]
2083 SQLRETURN WINAPI
SQLGetDescRecW(SQLHDESC DescriptorHandle
, SQLSMALLINT RecNumber
, WCHAR
*Name
,
2084 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
, SQLSMALLINT
*Type
,
2085 SQLSMALLINT
*SubType
, SQLLEN
*Length
, SQLSMALLINT
*Precision
,
2086 SQLSMALLINT
*Scale
, SQLSMALLINT
*Nullable
)
2088 struct SQLGetDescRecW_params params
= { DescriptorHandle
, RecNumber
, Name
, BufferLength
, StringLength
,
2089 Type
, SubType
, Length
, Precision
, Scale
, Nullable
};
2092 TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p,"
2093 " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle
, RecNumber
, Name
, BufferLength
,
2094 StringLength
, Type
, SubType
, Length
, Precision
, Scale
, Nullable
);
2096 ret
= ODBC_CALL( SQLGetDescRecW
, ¶ms
);
2097 TRACE("Returning %d\n", ret
);
2101 /*************************************************************************
2102 * SQLGetDiagFieldW [ODBC32.135]
2104 SQLRETURN WINAPI
SQLGetDiagFieldW(SQLSMALLINT HandleType
, SQLHANDLE Handle
, SQLSMALLINT RecNumber
,
2105 SQLSMALLINT DiagIdentifier
, SQLPOINTER DiagInfo
, SQLSMALLINT BufferLength
,
2106 SQLSMALLINT
*StringLength
)
2108 struct SQLGetDiagFieldW_params params
= { HandleType
, Handle
, RecNumber
, DiagIdentifier
, DiagInfo
,
2109 BufferLength
, StringLength
};
2112 TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d,"
2113 " StringLength %p)\n", HandleType
, Handle
, RecNumber
, DiagIdentifier
, DiagInfo
, BufferLength
, StringLength
);
2115 ret
= ODBC_CALL( SQLGetDiagFieldW
, ¶ms
);
2116 TRACE("Returning %d\n", ret
);
2120 /*************************************************************************
2121 * SQLGetDiagRecW [ODBC32.136]
2123 SQLRETURN WINAPI
SQLGetDiagRecW(SQLSMALLINT HandleType
, SQLHANDLE Handle
, SQLSMALLINT RecNumber
,
2124 WCHAR
*Sqlstate
, SQLINTEGER
*NativeError
, WCHAR
*MessageText
,
2125 SQLSMALLINT BufferLength
, SQLSMALLINT
*TextLength
)
2127 struct SQLGetDiagRecW_params params
= { HandleType
, Handle
, RecNumber
, Sqlstate
, NativeError
,
2128 MessageText
, BufferLength
, TextLength
};
2131 TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d,"
2132 " TextLength %p)\n", HandleType
, Handle
, RecNumber
, Sqlstate
, NativeError
, MessageText
, BufferLength
,
2135 ret
= ODBC_CALL( SQLGetDiagRecW
, ¶ms
);
2136 TRACE("Returning %d\n", ret
);
2140 /*************************************************************************
2141 * SQLGetStmtAttrW [ODBC32.138]
2143 SQLRETURN WINAPI
SQLGetStmtAttrW(SQLHSTMT StatementHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
2144 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
2146 struct SQLGetStmtAttrW_params params
= { StatementHandle
, Attribute
, Value
, BufferLength
, StringLength
};
2149 TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle
,
2150 Attribute
, Value
, BufferLength
, StringLength
);
2154 WARN("Unexpected NULL Value return address\n");
2158 ret
= ODBC_CALL( SQLGetStmtAttrW
, ¶ms
);
2159 TRACE("Returning %d\n", ret
);
2163 /*************************************************************************
2164 * SQLSetConnectAttrW [ODBC32.139]
2166 SQLRETURN WINAPI
SQLSetConnectAttrW(SQLHDBC ConnectionHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
2167 SQLINTEGER StringLength
)
2169 struct SQLSetConnectAttrW_params params
= { ConnectionHandle
, Attribute
, Value
, StringLength
};
2172 TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle
, Attribute
, Value
,
2175 ret
= ODBC_CALL( SQLSetConnectAttrW
, ¶ms
);
2176 TRACE("Returning %d\n", ret
);
2180 /*************************************************************************
2181 * SQLColumnsW [ODBC32.140]
2183 SQLRETURN WINAPI
SQLColumnsW(SQLHSTMT StatementHandle
, WCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
2184 WCHAR
*SchemaName
, SQLSMALLINT NameLength2
, WCHAR
*TableName
,
2185 SQLSMALLINT NameLength3
, WCHAR
*ColumnName
, SQLSMALLINT NameLength4
)
2187 struct SQLColumnsW_params params
= { StatementHandle
, CatalogName
, NameLength1
, SchemaName
,
2188 NameLength2
, TableName
, NameLength3
, ColumnName
, NameLength4
};
2191 TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
2192 " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle
,
2193 debugstr_wn(CatalogName
, NameLength1
), NameLength1
, debugstr_wn(SchemaName
, NameLength2
), NameLength2
,
2194 debugstr_wn(TableName
, NameLength3
), NameLength3
, debugstr_wn(ColumnName
, NameLength4
), NameLength4
);
2196 ret
= ODBC_CALL( SQLColumnsW
, ¶ms
);
2197 TRACE("Returning %d\n", ret
);
2201 /*************************************************************************
2202 * SQLDriverConnectW [ODBC32.141]
2204 SQLRETURN WINAPI
SQLDriverConnectW(SQLHDBC ConnectionHandle
, SQLHWND WindowHandle
, WCHAR
*InConnectionString
,
2205 SQLSMALLINT Length
, WCHAR
*OutConnectionString
, SQLSMALLINT BufferLength
,
2206 SQLSMALLINT
*Length2
, SQLUSMALLINT DriverCompletion
)
2208 struct SQLDriverConnectW_params params
= { ConnectionHandle
, WindowHandle
, InConnectionString
, Length
,
2209 OutConnectionString
, BufferLength
, Length2
, DriverCompletion
};
2212 TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p,"
2213 " BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle
, WindowHandle
,
2214 debugstr_wn(InConnectionString
, Length
), Length
, OutConnectionString
, BufferLength
, Length2
,
2217 ret
= ODBC_CALL( SQLDriverConnectW
, ¶ms
);
2218 TRACE("Returning %d\n", ret
);
2222 /*************************************************************************
2223 * SQLGetConnectOptionW [ODBC32.142]
2225 SQLRETURN WINAPI
SQLGetConnectOptionW(SQLHDBC ConnectionHandle
, SQLUSMALLINT Option
, SQLPOINTER Value
)
2227 struct SQLGetConnectOptionW_params params
= { ConnectionHandle
, Option
, Value
};
2230 TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle
, Option
, Value
);
2232 ret
= ODBC_CALL( SQLGetConnectOptionW
, ¶ms
);
2233 TRACE("Returning %d\n", ret
);
2237 /*************************************************************************
2238 * SQLGetInfoW [ODBC32.145]
2240 SQLRETURN WINAPI
SQLGetInfoW(SQLHDBC ConnectionHandle
, SQLUSMALLINT InfoType
, SQLPOINTER InfoValue
,
2241 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
)
2243 struct SQLGetInfoW_params params
= { ConnectionHandle
, InfoType
, InfoValue
, BufferLength
, StringLength
};
2246 TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle
,
2247 InfoType
, InfoValue
, BufferLength
, StringLength
);
2251 WARN("Unexpected NULL InfoValue address\n");
2255 ret
= ODBC_CALL( SQLGetInfoW
, ¶ms
);
2256 TRACE("Returning %d\n", ret
);
2260 /*************************************************************************
2261 * SQLGetTypeInfoW [ODBC32.147]
2263 SQLRETURN WINAPI
SQLGetTypeInfoW(SQLHSTMT StatementHandle
, SQLSMALLINT DataType
)
2265 struct SQLGetTypeInfoW_params params
= { StatementHandle
, DataType
};
2268 TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle
, DataType
);
2270 ret
= ODBC_CALL( SQLGetTypeInfoW
, ¶ms
);
2271 TRACE("Returning %d\n", ret
);
2275 /*************************************************************************
2276 * SQLSetConnectOptionW [ODBC32.150]
2278 SQLRETURN WINAPI
SQLSetConnectOptionW(SQLHDBC ConnectionHandle
, SQLUSMALLINT Option
, SQLLEN Value
)
2280 struct SQLSetConnectOptionW_params params
= { ConnectionHandle
, Option
, Value
};
2283 TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle
, Option
, debugstr_sqllen(Value
));
2285 ret
= ODBC_CALL( SQLSetConnectOptionW
, ¶ms
);
2286 TRACE("Returning %d\n", ret
);
2290 /*************************************************************************
2291 * SQLSpecialColumnsW [ODBC32.152]
2293 SQLRETURN WINAPI
SQLSpecialColumnsW(SQLHSTMT StatementHandle
, SQLUSMALLINT IdentifierType
,
2294 SQLWCHAR
*CatalogName
, SQLSMALLINT NameLength1
, SQLWCHAR
*SchemaName
,
2295 SQLSMALLINT NameLength2
, SQLWCHAR
*TableName
, SQLSMALLINT NameLength3
,
2296 SQLUSMALLINT Scope
, SQLUSMALLINT Nullable
)
2298 struct SQLSpecialColumnsW_params params
= { StatementHandle
, IdentifierType
, CatalogName
, NameLength1
,
2299 SchemaName
, NameLength2
, TableName
, NameLength3
, Scope
, Nullable
};
2302 TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d,"
2303 " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle
, IdentifierType
,
2304 debugstr_wn(CatalogName
, NameLength1
), NameLength1
, debugstr_wn(SchemaName
, NameLength2
), NameLength2
,
2305 debugstr_wn(TableName
, NameLength3
), NameLength3
, Scope
, Nullable
);
2307 ret
= ODBC_CALL( SQLSpecialColumnsW
, ¶ms
);
2308 TRACE("Returning %d\n", ret
);
2312 /*************************************************************************
2313 * SQLStatisticsW [ODBC32.153]
2315 SQLRETURN WINAPI
SQLStatisticsW(SQLHSTMT StatementHandle
, SQLWCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
2316 SQLWCHAR
*SchemaName
, SQLSMALLINT NameLength2
, SQLWCHAR
*TableName
,
2317 SQLSMALLINT NameLength3
, SQLUSMALLINT Unique
, SQLUSMALLINT Reserved
)
2319 struct SQLStatisticsW_params params
= { StatementHandle
, CatalogName
, NameLength1
, SchemaName
,
2320 NameLength2
, TableName
, NameLength3
, Unique
, Reserved
};
2323 TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s"
2324 " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle
,
2325 debugstr_wn(CatalogName
, NameLength1
), NameLength1
, debugstr_wn(SchemaName
, NameLength2
), NameLength2
,
2326 debugstr_wn(TableName
, NameLength3
), NameLength3
, Unique
, Reserved
);
2328 ret
= ODBC_CALL( SQLStatisticsW
, ¶ms
);
2329 TRACE("Returning %d\n", ret
);
2333 /*************************************************************************
2334 * SQLTablesW [ODBC32.154]
2336 SQLRETURN WINAPI
SQLTablesW(SQLHSTMT StatementHandle
, SQLWCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
2337 SQLWCHAR
*SchemaName
, SQLSMALLINT NameLength2
, SQLWCHAR
*TableName
,
2338 SQLSMALLINT NameLength3
, SQLWCHAR
*TableType
, SQLSMALLINT NameLength4
)
2340 struct SQLTablesW_params params
= { StatementHandle
, CatalogName
, NameLength1
, SchemaName
, NameLength2
,
2341 TableName
, NameLength3
, TableType
, NameLength4
};
2344 TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s,"
2345 " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle
,
2346 debugstr_wn(CatalogName
, NameLength1
), NameLength1
, debugstr_wn(SchemaName
, NameLength2
), NameLength2
,
2347 debugstr_wn(TableName
, NameLength3
), NameLength3
, debugstr_wn(TableType
, NameLength4
), NameLength4
);
2349 ret
= ODBC_CALL( SQLTablesW
, ¶ms
);
2350 TRACE("Returning %d\n", ret
);
2354 /*************************************************************************
2355 * SQLBrowseConnectW [ODBC32.155]
2357 SQLRETURN WINAPI
SQLBrowseConnectW(SQLHDBC hdbc
, SQLWCHAR
*szConnStrIn
, SQLSMALLINT cbConnStrIn
,
2358 SQLWCHAR
*szConnStrOut
, SQLSMALLINT cbConnStrOutMax
,
2359 SQLSMALLINT
*pcbConnStrOut
)
2361 struct SQLBrowseConnectW_params params
= { hdbc
, szConnStrIn
, cbConnStrIn
, szConnStrOut
,
2362 cbConnStrOutMax
, pcbConnStrOut
};
2365 TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n",
2366 hdbc
, debugstr_wn(szConnStrIn
, cbConnStrIn
), cbConnStrIn
, szConnStrOut
, cbConnStrOutMax
, pcbConnStrOut
);
2368 ret
= ODBC_CALL( SQLBrowseConnectW
, ¶ms
);
2369 TRACE("Returning %d\n", ret
);
2373 /*************************************************************************
2374 * SQLColumnPrivilegesW [ODBC32.156]
2376 SQLRETURN WINAPI
SQLColumnPrivilegesW(SQLHSTMT hstmt
, SQLWCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
2377 SQLWCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLWCHAR
*szTableName
,
2378 SQLSMALLINT cbTableName
, SQLWCHAR
*szColumnName
, SQLSMALLINT cbColumnName
)
2380 struct SQLColumnPrivilegesW_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
2381 cbSchemaName
, szTableName
, cbTableName
, szColumnName
,
2385 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
2386 " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt
,
2387 debugstr_wn(szCatalogName
, cbCatalogName
), cbCatalogName
,
2388 debugstr_wn(szSchemaName
, cbSchemaName
), cbSchemaName
,
2389 debugstr_wn(szTableName
, cbTableName
), cbTableName
,
2390 debugstr_wn(szColumnName
, cbColumnName
), cbColumnName
);
2392 ret
= ODBC_CALL( SQLColumnPrivilegesW
, ¶ms
);
2393 TRACE("Returning %d\n", ret
);
2397 /*************************************************************************
2398 * SQLDataSourcesW [ODBC32.157]
2400 SQLRETURN WINAPI
SQLDataSourcesW(SQLHENV EnvironmentHandle
, SQLUSMALLINT Direction
, WCHAR
*ServerName
,
2401 SQLSMALLINT BufferLength1
, SQLSMALLINT
*NameLength1
, WCHAR
*Description
,
2402 SQLSMALLINT BufferLength2
, SQLSMALLINT
*NameLength2
)
2404 struct SQLDataSourcesW_params params
= { EnvironmentHandle
, Direction
, ServerName
, BufferLength1
,
2405 NameLength1
, Description
, BufferLength2
, NameLength2
};
2408 TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p,"
2409 " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle
, Direction
, ServerName
, BufferLength1
,
2410 NameLength1
, Description
, BufferLength2
, NameLength2
);
2412 ret
= ODBC_CALL( SQLDataSourcesW
, ¶ms
);
2414 if (ret
>= 0 && TRACE_ON(odbc
))
2416 if (ServerName
&& NameLength1
&& *NameLength1
> 0)
2417 TRACE(" DataSource %s", debugstr_wn(ServerName
, *NameLength1
));
2418 if (Description
&& NameLength2
&& *NameLength2
> 0)
2419 TRACE(" Description %s", debugstr_wn(Description
, *NameLength2
));
2423 TRACE("Returning %d\n", ret
);
2427 /*************************************************************************
2428 * SQLForeignKeysW [ODBC32.160]
2430 SQLRETURN WINAPI
SQLForeignKeysW(SQLHSTMT hstmt
, SQLWCHAR
*szPkCatalogName
, SQLSMALLINT cbPkCatalogName
,
2431 SQLWCHAR
*szPkSchemaName
, SQLSMALLINT cbPkSchemaName
, SQLWCHAR
*szPkTableName
,
2432 SQLSMALLINT cbPkTableName
, SQLWCHAR
*szFkCatalogName
,
2433 SQLSMALLINT cbFkCatalogName
, SQLWCHAR
*szFkSchemaName
,
2434 SQLSMALLINT cbFkSchemaName
, SQLWCHAR
*szFkTableName
, SQLSMALLINT cbFkTableName
)
2436 struct SQLForeignKeysW_params params
= { hstmt
, szPkCatalogName
, cbPkCatalogName
, szPkSchemaName
,
2437 cbPkSchemaName
, szPkTableName
, cbPkTableName
, szFkCatalogName
,
2438 cbFkCatalogName
, szFkSchemaName
, cbFkSchemaName
, szFkTableName
,
2442 TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d,"
2443 " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s,"
2444 " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt
,
2445 debugstr_wn(szPkCatalogName
, cbPkCatalogName
), cbPkCatalogName
,
2446 debugstr_wn(szPkSchemaName
, cbPkSchemaName
), cbPkSchemaName
,
2447 debugstr_wn(szPkTableName
, cbPkTableName
), cbPkTableName
,
2448 debugstr_wn(szFkCatalogName
, cbFkCatalogName
), cbFkCatalogName
,
2449 debugstr_wn(szFkSchemaName
, cbFkSchemaName
), cbFkSchemaName
,
2450 debugstr_wn(szFkTableName
, cbFkTableName
), cbFkTableName
);
2452 ret
= ODBC_CALL( SQLForeignKeysW
, ¶ms
);
2453 TRACE("Returning %d\n", ret
);
2457 /*************************************************************************
2458 * SQLNativeSqlW [ODBC32.162]
2460 SQLRETURN WINAPI
SQLNativeSqlW(SQLHDBC hdbc
, SQLWCHAR
*szSqlStrIn
, SQLINTEGER cbSqlStrIn
, SQLWCHAR
*szSqlStr
,
2461 SQLINTEGER cbSqlStrMax
, SQLINTEGER
*pcbSqlStr
)
2463 struct SQLNativeSqlW_params params
= { hdbc
, szSqlStrIn
, cbSqlStrIn
, szSqlStr
, cbSqlStrMax
, pcbSqlStr
};
2466 TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc
,
2467 debugstr_wn(szSqlStrIn
, cbSqlStrIn
), cbSqlStrIn
, szSqlStr
, cbSqlStrMax
, pcbSqlStr
);
2469 ret
= ODBC_CALL( SQLNativeSqlW
, ¶ms
);
2470 TRACE("Returning %d\n", ret
);
2474 /*************************************************************************
2475 * SQLPrimaryKeysW [ODBC32.165]
2477 SQLRETURN WINAPI
SQLPrimaryKeysW(SQLHSTMT hstmt
, SQLWCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
2478 SQLWCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLWCHAR
*szTableName
,
2479 SQLSMALLINT cbTableName
)
2481 struct SQLPrimaryKeysW_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
2482 cbSchemaName
, szTableName
, cbTableName
};
2485 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
2486 " cbTableName %d)\n", hstmt
,
2487 debugstr_wn(szCatalogName
, cbCatalogName
), cbCatalogName
,
2488 debugstr_wn(szSchemaName
, cbSchemaName
), cbSchemaName
,
2489 debugstr_wn(szTableName
, cbTableName
), cbTableName
);
2491 ret
= ODBC_CALL( SQLPrimaryKeysW
, ¶ms
);
2492 TRACE("Returning %d\n", ret
);
2496 /*************************************************************************
2497 * SQLProcedureColumnsW [ODBC32.166]
2499 SQLRETURN WINAPI
SQLProcedureColumnsW(SQLHSTMT hstmt
, SQLWCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
2500 SQLWCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLWCHAR
*szProcName
,
2501 SQLSMALLINT cbProcName
, SQLWCHAR
*szColumnName
, SQLSMALLINT cbColumnName
)
2503 struct SQLProcedureColumnsW_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
2504 cbSchemaName
, szProcName
, cbProcName
,
2505 szColumnName
, cbColumnName
};
2508 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
2509 " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt
,
2510 debugstr_wn(szCatalogName
, cbCatalogName
), cbCatalogName
,
2511 debugstr_wn(szSchemaName
, cbSchemaName
), cbSchemaName
,
2512 debugstr_wn(szProcName
, cbProcName
), cbProcName
,
2513 debugstr_wn(szColumnName
, cbColumnName
), cbColumnName
);
2515 ret
= ODBC_CALL( SQLProcedureColumnsW
, ¶ms
);
2516 TRACE("Returning %d\n", ret
);
2520 /*************************************************************************
2521 * SQLProceduresW [ODBC32.167]
2523 SQLRETURN WINAPI
SQLProceduresW(SQLHSTMT hstmt
, SQLWCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
2524 SQLWCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLWCHAR
*szProcName
,
2525 SQLSMALLINT cbProcName
)
2527 struct SQLProceduresW_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
2528 cbSchemaName
, szProcName
, cbProcName
};
2531 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s,"
2532 " cbProcName %d)\n", hstmt
, debugstr_wn(szCatalogName
, cbCatalogName
), cbCatalogName
,
2533 debugstr_wn(szSchemaName
, cbSchemaName
), cbSchemaName
, debugstr_wn(szProcName
, cbProcName
), cbProcName
);
2535 ret
= ODBC_CALL( SQLProceduresW
, ¶ms
);
2536 TRACE("Returning %d\n", ret
);
2540 /*************************************************************************
2541 * SQLTablePrivilegesW [ODBC32.170]
2543 SQLRETURN WINAPI
SQLTablePrivilegesW(SQLHSTMT hstmt
, SQLWCHAR
*szCatalogName
, SQLSMALLINT cbCatalogName
,
2544 SQLWCHAR
*szSchemaName
, SQLSMALLINT cbSchemaName
, SQLWCHAR
*szTableName
,
2545 SQLSMALLINT cbTableName
)
2547 struct SQLTablePrivilegesW_params params
= { hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
,
2548 cbSchemaName
, szTableName
, cbTableName
};
2551 TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s,"
2552 " cbTableName %d)\n", hstmt
, debugstr_wn(szCatalogName
, cbCatalogName
), cbCatalogName
,
2553 debugstr_wn(szSchemaName
, cbSchemaName
), cbSchemaName
, debugstr_wn(szTableName
, cbTableName
), cbTableName
);
2555 ret
= ODBC_CALL( SQLTablePrivilegesW
, ¶ms
);
2556 TRACE("Returning %d\n", ret
);
2560 /*************************************************************************
2561 * SQLDriversW [ODBC32.171]
2563 SQLRETURN WINAPI
SQLDriversW(SQLHENV EnvironmentHandle
, SQLUSMALLINT fDirection
, SQLWCHAR
*szDriverDesc
,
2564 SQLSMALLINT cbDriverDescMax
, SQLSMALLINT
*pcbDriverDesc
,
2565 SQLWCHAR
*szDriverAttributes
, SQLSMALLINT cbDriverAttrMax
,
2566 SQLSMALLINT
*pcbDriverAttr
)
2568 struct SQLDriversW_params params
= { EnvironmentHandle
, fDirection
, szDriverDesc
, cbDriverDescMax
,
2569 pcbDriverDesc
, szDriverAttributes
, cbDriverAttrMax
, pcbDriverAttr
};
2572 TRACE("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p,"
2573 " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle
, fDirection
,
2574 szDriverDesc
, cbDriverDescMax
, pcbDriverDesc
, szDriverAttributes
, cbDriverAttrMax
, pcbDriverAttr
);
2576 ret
= ODBC_CALL( SQLDriversW
, ¶ms
);
2578 if (ret
== SQL_NO_DATA
&& fDirection
== SQL_FETCH_FIRST
)
2579 ERR_(winediag
)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n");
2581 TRACE("Returning %d\n", ret
);
2585 /*************************************************************************
2586 * SQLSetDescFieldW [ODBC32.173]
2588 SQLRETURN WINAPI
SQLSetDescFieldW(SQLHDESC DescriptorHandle
, SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
2589 SQLPOINTER Value
, SQLINTEGER BufferLength
)
2591 struct SQLSetDescFieldW_params params
= { DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
, BufferLength
};
2594 TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle
,
2595 RecNumber
, FieldIdentifier
, Value
, BufferLength
);
2597 ret
= ODBC_CALL( SQLSetDescFieldW
, ¶ms
);
2598 TRACE("Returning %d\n", ret
);
2602 /*************************************************************************
2603 * SQLSetStmtAttrW [ODBC32.176]
2605 SQLRETURN WINAPI
SQLSetStmtAttrW(SQLHSTMT StatementHandle
, SQLINTEGER Attribute
, SQLPOINTER Value
,
2606 SQLINTEGER StringLength
)
2608 struct SQLSetStmtAttrW_params params
= { StatementHandle
, Attribute
, Value
, StringLength
};
2611 TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle
, Attribute
, Value
,
2614 ret
= ODBC_CALL( SQLSetStmtAttrW
, ¶ms
);
2615 if (ret
== SQL_ERROR
&& (Attribute
== SQL_ROWSET_SIZE
|| Attribute
== SQL_ATTR_ROW_ARRAY_SIZE
))
2617 TRACE("CHEAT: returning SQL_SUCCESS to ADO\n");
2621 TRACE("Returning %d\n", ret
);
2625 /*************************************************************************
2626 * SQLGetDiagRecA [ODBC32.236]
2628 SQLRETURN WINAPI
SQLGetDiagRecA(SQLSMALLINT HandleType
, SQLHANDLE Handle
, SQLSMALLINT RecNumber
,
2629 SQLCHAR
*Sqlstate
, SQLINTEGER
*NativeError
, SQLCHAR
*MessageText
,
2630 SQLSMALLINT BufferLength
, SQLSMALLINT
*TextLength
)
2632 struct SQLGetDiagRecA_params params
= { HandleType
, Handle
, RecNumber
, Sqlstate
, NativeError
,
2633 MessageText
, BufferLength
, TextLength
};
2636 TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d,"
2637 " TextLength %p)\n", HandleType
, Handle
, RecNumber
, Sqlstate
, NativeError
, MessageText
, BufferLength
,
2640 ret
= ODBC_CALL( SQLGetDiagRecA
, ¶ms
);
2641 TRACE("Returning %d\n", ret
);
2646 /***********************************************************************
2647 * DllMain [Internal] Initializes the internal 'ODBC32.DLL'.
2649 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD reason
, LPVOID reserved
)
2651 TRACE("proxy ODBC: %p,%lx,%p\n", hinstDLL
, reason
, reserved
);
2655 case DLL_PROCESS_ATTACH
:
2656 DisableThreadLibraryCalls(hinstDLL
);
2657 if (!NtQueryVirtualMemory( GetCurrentProcess(), hinstDLL
, MemoryWineUnixFuncs
,
2658 &odbc_handle
, sizeof(odbc_handle
), NULL
) &&
2659 !__wine_unix_call( odbc_handle
, process_attach
, NULL
))
2661 ODBC_ReplicateToRegistry();
2665 case DLL_PROCESS_DETACH
:
2666 if (reserved
) break;
2667 __wine_unix_call( odbc_handle
, process_detach
, NULL
);