4 * Proxy ODBC driver manager. This manager delegates all ODBC calls to a real ODBC driver manager which is either:
5 * 1) its name is defined in the environment variable LIB_ODBC_DRIVER_MANAGER
6 * 2) if LIB_ODBC_DRIVER_MANAGER is not defined, a default library libodbc.so will be used.
8 * Copyright 1999 Xiang Li, Corel Corporation
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/port.h"
34 #include "wine/debug.h"
35 #include "wine/library.h"
41 #include "proxyodbc.h"
43 static BOOL
ODBC_LoadDriverManager(void);
44 static BOOL
ODBC_LoadDMFunctions(void);
46 WINE_DEFAULT_DEBUG_CHANNEL(odbc
);
48 static const DM_FUNC template_func
[] =
50 /* 00 */ { SQL_API_SQLALLOCCONNECT
, "SQLAllocConnect", SQLAllocConnect
, NULL
},
51 /* 01 */ { SQL_API_SQLALLOCENV
, "SQLAllocEnv", SQLAllocEnv
, NULL
},
52 /* 02 */ { SQL_API_SQLALLOCHANDLE
, "SQLAllocHandle", SQLAllocHandle
, NULL
},
53 /* 03 */ { SQL_API_SQLALLOCSTMT
, "SQLAllocStmt", SQLAllocStmt
, NULL
},
54 /* 04 */ { SQL_API_SQLALLOCHANDLESTD
, "SQLAllocHandleStd", SQLAllocHandleStd
, NULL
},
55 /* 05 */ { SQL_API_SQLBINDCOL
, "SQLBindCol", SQLBindCol
, NULL
},
56 /* 06 */ { SQL_API_SQLBINDPARAM
, "SQLBindParam", SQLBindParam
, NULL
},
57 /* 07 */ { SQL_API_SQLBINDPARAMETER
, "SQLBindParameter", SQLBindParameter
, NULL
},
58 /* 08 */ { SQL_API_SQLBROWSECONNECT
, "SQLBrowseConnect", SQLBrowseConnect
, NULL
},
59 /* 09 */ { SQL_API_SQLBULKOPERATIONS
, "SQLBulkOperations", SQLBulkOperations
, NULL
},
60 /* 10 */ { SQL_API_SQLCANCEL
, "SQLCancel", SQLCancel
, NULL
},
61 /* 11 */ { SQL_API_SQLCLOSECURSOR
, "SQLCloseCursor", SQLCloseCursor
, NULL
},
62 /* 12 */ { SQL_API_SQLCOLATTRIBUTE
, "SQLColAttribute", SQLColAttribute
, NULL
},
63 /* 13 */ { SQL_API_SQLCOLATTRIBUTES
, "SQLColAttributes", SQLColAttributes
, NULL
},
64 /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES
, "SQLColumnPrivileges", SQLColumnPrivileges
, NULL
},
65 /* 15 */ { SQL_API_SQLCOLUMNS
, "SQLColumns", SQLColumns
, NULL
},
66 /* 16 */ { SQL_API_SQLCONNECT
, "SQLConnect", SQLConnect
, NULL
},
67 /* 17 */ { SQL_API_SQLCOPYDESC
, "SQLCopyDesc", SQLCopyDesc
, NULL
},
68 /* 18 */ { SQL_API_SQLDATASOURCES
, "SQLDataSources", SQLDataSources
, NULL
},
69 /* 19 */ { SQL_API_SQLDESCRIBECOL
, "SQLDescribeCol", SQLDescribeCol
, NULL
},
70 /* 20 */ { SQL_API_SQLDESCRIBEPARAM
, "SQLDescribeParam", SQLDescribeParam
, NULL
},
71 /* 21 */ { SQL_API_SQLDISCONNECT
, "SQLDisconnect", SQLDisconnect
, NULL
},
72 /* 22 */ { SQL_API_SQLDRIVERCONNECT
, "SQLDriverConnect", SQLDriverConnect
, NULL
},
73 /* 23 */ { SQL_API_SQLDRIVERS
, "SQLDrivers", SQLDrivers
, NULL
},
74 /* 24 */ { SQL_API_SQLENDTRAN
, "SQLEndTran", SQLEndTran
, NULL
},
75 /* 25 */ { SQL_API_SQLERROR
, "SQLError", SQLError
, NULL
},
76 /* 26 */ { SQL_API_SQLEXECDIRECT
, "SQLExecDirect", SQLExecDirect
, NULL
},
77 /* 27 */ { SQL_API_SQLEXECUTE
, "SQLExecute", SQLExecute
, NULL
},
78 /* 28 */ { SQL_API_SQLEXTENDEDFETCH
, "SQLExtendedFetch", SQLExtendedFetch
, NULL
},
79 /* 29 */ { SQL_API_SQLFETCH
, "SQLFetch", SQLFetch
, NULL
},
80 /* 30 */ { SQL_API_SQLFETCHSCROLL
, "SQLFetchScroll", SQLFetchScroll
, NULL
},
81 /* 31 */ { SQL_API_SQLFOREIGNKEYS
, "SQLForeignKeys", SQLForeignKeys
, NULL
},
82 /* 32 */ { SQL_API_SQLFREEENV
, "SQLFreeEnv", SQLFreeEnv
, NULL
},
83 /* 33 */ { SQL_API_SQLFREEHANDLE
, "SQLFreeHandle", SQLFreeHandle
, NULL
},
84 /* 34 */ { SQL_API_SQLFREESTMT
, "SQLFreeStmt", SQLFreeStmt
, NULL
},
85 /* 35 */ { SQL_API_SQLFREECONNECT
, "SQLFreeConnect", SQLFreeConnect
, NULL
},
86 /* 36 */ { SQL_API_SQLGETCONNECTATTR
, "SQLGetConnectAttr", SQLGetConnectAttr
, NULL
},
87 /* 37 */ { SQL_API_SQLGETCONNECTOPTION
, "SQLGetConnectOption", SQLGetConnectOption
, NULL
},
88 /* 38 */ { SQL_API_SQLGETCURSORNAME
, "SQLGetCursorName", SQLGetCursorName
, NULL
},
89 /* 39 */ { SQL_API_SQLGETDATA
, "SQLGetData", SQLGetData
, NULL
},
90 /* 40 */ { SQL_API_SQLGETDESCFIELD
, "SQLGetDescField", SQLGetDescField
, NULL
},
91 /* 41 */ { SQL_API_SQLGETDESCREC
, "SQLGetDescRec", SQLGetDescRec
, NULL
},
92 /* 42 */ { SQL_API_SQLGETDIAGFIELD
, "SQLGetDiagField", SQLGetDiagField
, NULL
},
93 /* 43 */ { SQL_API_SQLGETENVATTR
, "SQLGetEnvAttr", SQLGetEnvAttr
, NULL
},
94 /* 44 */ { SQL_API_SQLGETFUNCTIONS
, "SQLGetFunctions", SQLGetFunctions
, NULL
},
95 /* 45 */ { SQL_API_SQLGETINFO
, "SQLGetInfo", SQLGetInfo
, NULL
},
96 /* 46 */ { SQL_API_SQLGETSTMTATTR
, "SQLGetStmtAttr", SQLGetStmtAttr
, NULL
},
97 /* 47 */ { SQL_API_SQLGETSTMTOPTION
, "SQLGetStmtOption", SQLGetStmtOption
, NULL
},
98 /* 48 */ { SQL_API_SQLGETTYPEINFO
, "SQLGetTypeInfo", SQLGetTypeInfo
, NULL
},
99 /* 49 */ { SQL_API_SQLMORERESULTS
, "SQLMoreResults", SQLMoreResults
, NULL
},
100 /* 50 */ { SQL_API_SQLNATIVESQL
, "SQLNativeSql", SQLNativeSql
, NULL
},
101 /* 51 */ { SQL_API_SQLNUMPARAMS
, "SQLNumParams", SQLNumParams
, NULL
},
102 /* 52 */ { SQL_API_SQLNUMRESULTCOLS
, "SQLNumResultCols", SQLNumResultCols
, NULL
},
103 /* 53 */ { SQL_API_SQLPARAMDATA
, "SQLParamData", SQLParamData
, NULL
},
104 /* 54 */ { SQL_API_SQLPARAMOPTIONS
, "SQLParamOptions", SQLParamOptions
, NULL
},
105 /* 55 */ { SQL_API_SQLPREPARE
, "SQLPrepare", SQLPrepare
, NULL
},
106 /* 56 */ { SQL_API_SQLPRIMARYKEYS
, "SQLPrimaryKeys", SQLPrimaryKeys
, NULL
},
107 /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS
, "SQLProcedureColumns", SQLProcedureColumns
, NULL
},
108 /* 58 */ { SQL_API_SQLPROCEDURES
, "SQLProcedures", SQLProcedures
, NULL
},
109 /* 59 */ { SQL_API_SQLPUTDATA
, "SQLPutData", SQLPutData
, NULL
},
110 /* 60 */ { SQL_API_SQLROWCOUNT
, "SQLRowCount", SQLRowCount
, NULL
},
111 /* 61 */ { SQL_API_SQLSETCONNECTATTR
, "SQLSetConnectAttr", SQLSetConnectAttr
, NULL
},
112 /* 62 */ { SQL_API_SQLSETCONNECTOPTION
, "SQLSetConnectOption", SQLSetConnectOption
, NULL
},
113 /* 63 */ { SQL_API_SQLSETCURSORNAME
, "SQLSetCursorName", SQLSetCursorName
, NULL
},
114 /* 64 */ { SQL_API_SQLSETDESCFIELD
, "SQLSetDescField", SQLSetDescField
, NULL
},
115 /* 65 */ { SQL_API_SQLSETDESCREC
, "SQLSetDescRec", SQLSetDescRec
, NULL
},
116 /* 66 */ { SQL_API_SQLSETENVATTR
, "SQLSetEnvAttr", SQLSetEnvAttr
, NULL
},
117 /* 67 */ { SQL_API_SQLSETPARAM
, "SQLSetParam", SQLSetParam
, NULL
},
118 /* 68 */ { SQL_API_SQLSETPOS
, "SQLSetPos", SQLSetPos
, NULL
},
119 /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS
, "SQLSetScrollOptions", SQLSetScrollOptions
, NULL
},
120 /* 70 */ { SQL_API_SQLSETSTMTATTR
, "SQLSetStmtAttr", SQLSetStmtAttr
, NULL
},
121 /* 71 */ { SQL_API_SQLSETSTMTOPTION
, "SQLSetStmtOption", SQLSetStmtOption
, NULL
},
122 /* 72 */ { SQL_API_SQLSPECIALCOLUMNS
, "SQLSpecialColumns", SQLSpecialColumns
, NULL
},
123 /* 73 */ { SQL_API_SQLSTATISTICS
, "SQLStatistics", SQLStatistics
, NULL
},
124 /* 74 */ { SQL_API_SQLTABLEPRIVILEGES
, "SQLTablePrivileges", SQLTablePrivileges
, NULL
},
125 /* 75 */ { SQL_API_SQLTABLES
, "SQLTables", SQLTables
, NULL
},
126 /* 76 */ { SQL_API_SQLTRANSACT
, "SQLTransact", SQLTransact
, NULL
},
127 /* 77 */ { SQL_API_SQLGETDIAGREC
, "SQLGetDiagRec", SQLGetDiagRec
, NULL
},
130 static PROXYHANDLE gProxyHandle
;
132 /* What is the difference between these two (dmHandle cf READY_AND_dmHandle)? When does one use one and when the other? */
134 #define CHECK_dmHandle() \
136 if (gProxyHandle.dmHandle == NULL) \
138 TRACE ("Not ready\n"); \
143 #define CHECK_READY_AND_dmHandle() \
145 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL) \
147 TRACE ("Not ready\n"); \
152 SQLRETURN
SQLDummyFunc()
154 TRACE("SQLDummyFunc: \n");
158 /***********************************************************************
159 * DllMain [Internal] Initializes the internal 'ODBC32.DLL'.
162 * hinstDLL [I] handle to the DLL's instance
164 * lpvReserved [I] reserved, must be NULL
171 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
174 TRACE("Initializing or Finalizing proxy ODBC: %p,%lx,%p\n", hinstDLL
, fdwReason
, lpvReserved
);
176 if (fdwReason
== DLL_PROCESS_ATTACH
)
178 TRACE("Loading ODBC...\n");
179 if (ODBC_LoadDriverManager())
180 ODBC_LoadDMFunctions();
182 else if (fdwReason
== DLL_PROCESS_DETACH
)
184 TRACE("Unloading ODBC...\n");
185 if (gProxyHandle
.bFunctionReady
)
187 for ( i
= 0; i
< NUM_SQLFUNC
; i
++ )
189 gProxyHandle
.functions
[i
].func
= SQLDummyFunc
;
193 if (gProxyHandle
.dmHandle
)
195 wine_dlclose(gProxyHandle
.dmHandle
,NULL
,0);
196 gProxyHandle
.dmHandle
= NULL
;
204 /***********************************************************************
205 * ODBC_LoadDriverManager [Internal] Load ODBC library.
214 static BOOL
ODBC_LoadDriverManager(void)
216 const char *s
= getenv("LIB_ODBC_DRIVER_MANAGER");
221 gProxyHandle
.bFunctionReady
= FALSE
;
222 gProxyHandle
.nErrorType
= ERROR_LIBRARY_NOT_FOUND
;
224 if (s
!= NULL
&& strlen (s
) >= sizeof(gProxyHandle
.dmLibName
))
226 ERR("Driver name too long (%s)\n",s
);
229 if (s
== NULL
|| strlen(s
) == 0)
231 strcpy(gProxyHandle
.dmLibName
, s
);
233 gProxyHandle
.dmHandle
= wine_dlopen(gProxyHandle
.dmLibName
, RTLD_LAZY
, error
, sizeof(error
));
235 if (gProxyHandle
.dmHandle
== NULL
) /* fail to load unixODBC driver manager */
237 WARN("failed to open library %s: %s\n", gProxyHandle
.dmLibName
, error
);
238 gProxyHandle
.dmLibName
[0] = '\0';
239 gProxyHandle
.nErrorType
= ERROR_LIBRARY_NOT_FOUND
;
244 gProxyHandle
.nErrorType
= ERROR_FREE
;
250 /***********************************************************************
251 * ODBC_LoadDMFunctions [Internal] Populate function table.
260 static BOOL
ODBC_LoadDMFunctions(void)
265 if (gProxyHandle
.dmHandle
== NULL
)
268 for ( i
= 0; i
< NUM_SQLFUNC
; i
++ )
270 gProxyHandle
.functions
[i
] = template_func
[i
];
271 gProxyHandle
.functions
[i
].func
= wine_dlsym(gProxyHandle
.dmHandle
,
272 gProxyHandle
.functions
[i
].name
, error
, sizeof(error
));
276 ERR("Failed to load function %s\n",gProxyHandle
.functions
[i
].name
);
277 gProxyHandle
.functions
[i
].func
= SQLDummyFunc
;
281 gProxyHandle
.bFunctionReady
= TRUE
;
287 /*************************************************************************
288 * SQLAllocConnect [ODBC32.001]
290 SQLRETURN WINAPI
SQLAllocConnect(SQLHENV EnvironmentHandle
, SQLHDBC
*ConnectionHandle
)
293 TRACE("Env=%lx\n",EnvironmentHandle
);
295 if (!gProxyHandle
.bFunctionReady
|| gProxyHandle
.dmHandle
== NULL
)
297 *ConnectionHandle
= SQL_NULL_HDBC
;
298 TRACE("Not ready\n");
302 assert(gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCCONNECT
].func
);
303 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCCONNECT
].func
)
304 (EnvironmentHandle
, ConnectionHandle
);
305 TRACE("Returns ret=%d, Handle %lx\n",ret
, *ConnectionHandle
);
310 /*************************************************************************
311 * SQLAllocEnv [ODBC32.002]
313 SQLRETURN WINAPI
SQLAllocEnv(SQLHENV
*EnvironmentHandle
)
318 if (!gProxyHandle
.bFunctionReady
|| gProxyHandle
.dmHandle
== NULL
)
320 *EnvironmentHandle
= SQL_NULL_HENV
;
321 TRACE("Not ready\n");
325 assert(gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCENV
].func
);
326 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCENV
].func
) (EnvironmentHandle
);
327 TRACE("Returns ret=%d, Env=%lx\n",ret
, *EnvironmentHandle
);
332 /*************************************************************************
333 * SQLAllocHandle [ODBC32.024]
335 SQLRETURN WINAPI
SQLAllocHandle(SQLSMALLINT HandleType
, SQLHANDLE InputHandle
, SQLHANDLE
*OutputHandle
)
338 TRACE("(Type=%d, Handle=%lx)\n",HandleType
,InputHandle
);
340 if (!gProxyHandle
.bFunctionReady
|| gProxyHandle
.dmHandle
== NULL
)
342 if (gProxyHandle
.nErrorType
== ERROR_LIBRARY_NOT_FOUND
)
343 WARN("ProxyODBC: Can not load ODBC driver manager library.\n");
345 if (HandleType
== SQL_HANDLE_ENV
)
346 *OutputHandle
= SQL_NULL_HENV
;
347 else if (HandleType
== SQL_HANDLE_DBC
)
348 *OutputHandle
= SQL_NULL_HDBC
;
349 else if (HandleType
== SQL_HANDLE_STMT
)
350 *OutputHandle
= SQL_NULL_HSTMT
;
351 else if (HandleType
== SQL_HANDLE_DESC
)
352 *OutputHandle
= SQL_NULL_HDESC
;
354 TRACE ("Not ready\n");
358 assert(gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCHANDLE
].func
);
359 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCHANDLE
].func
)
360 (HandleType
, InputHandle
, OutputHandle
);
361 TRACE("Returns ret=%d, Handle=%lx\n",ret
, *OutputHandle
);
366 /*************************************************************************
367 * SQLAllocStmt [ODBC32.003]
369 SQLRETURN WINAPI
SQLAllocStmt(SQLHDBC ConnectionHandle
, SQLHSTMT
*StatementHandle
)
373 TRACE("(Connection=%lx)\n",ConnectionHandle
);
375 if (!gProxyHandle
.bFunctionReady
|| gProxyHandle
.dmHandle
== NULL
)
377 *StatementHandle
= SQL_NULL_HSTMT
;
378 TRACE ("Not ready\n");
382 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCSTMT
].func
);
383 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCSTMT
].func
)
384 (ConnectionHandle
, StatementHandle
);
385 TRACE ("Returns ret=%d, Handle=%lx\n", ret
, *StatementHandle
);
390 /*************************************************************************
391 * SQLAllocHandleStd [ODBC32.077]
393 SQLRETURN WINAPI
SQLAllocHandleStd( SQLSMALLINT HandleType
,
394 SQLHANDLE InputHandle
, SQLHANDLE
*OutputHandle
)
396 TRACE("ProxyODBC: SQLAllocHandelStd.\n");
398 if (!gProxyHandle
.bFunctionReady
|| gProxyHandle
.dmHandle
== NULL
)
400 if (gProxyHandle
.nErrorType
== ERROR_LIBRARY_NOT_FOUND
)
401 WARN("ProxyODBC: Can not load ODBC driver manager library.\n");
403 if (HandleType
== SQL_HANDLE_ENV
)
404 *OutputHandle
= SQL_NULL_HENV
;
405 else if (HandleType
== SQL_HANDLE_DBC
)
406 *OutputHandle
= SQL_NULL_HDBC
;
407 else if (HandleType
== SQL_HANDLE_STMT
)
408 *OutputHandle
= SQL_NULL_HSTMT
;
409 else if (HandleType
== SQL_HANDLE_DESC
)
410 *OutputHandle
= SQL_NULL_HDESC
;
415 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCHANDLESTD
].func
);
416 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLALLOCHANDLESTD
].func
)
417 (HandleType
, InputHandle
, OutputHandle
);
421 /*************************************************************************
422 * SQLBindCol [ODBC32.004]
424 SQLRETURN WINAPI
SQLBindCol(SQLHSTMT StatementHandle
,
425 SQLUSMALLINT ColumnNumber
, SQLSMALLINT TargetType
,
426 SQLPOINTER TargetValue
, SQLINTEGER BufferLength
,
427 SQLINTEGER
*StrLen_or_Ind
)
431 if (!gProxyHandle
.bFunctionReady
|| gProxyHandle
.dmHandle
== NULL
)
433 TRACE ("Not ready\n");
437 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBINDCOL
].func
);
438 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBINDCOL
].func
)
439 (StatementHandle
, ColumnNumber
, TargetType
,
440 TargetValue
, BufferLength
, StrLen_or_Ind
);
444 /*************************************************************************
445 * SQLBindParam [ODBC32.025]
447 SQLRETURN WINAPI
SQLBindParam(SQLHSTMT StatementHandle
,
448 SQLUSMALLINT ParameterNumber
, SQLSMALLINT ValueType
,
449 SQLSMALLINT ParameterType
, SQLUINTEGER LengthPrecision
,
450 SQLSMALLINT ParameterScale
, SQLPOINTER ParameterValue
,
451 SQLINTEGER
*StrLen_or_Ind
)
455 CHECK_READY_AND_dmHandle();
457 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBINDPARAM
].func
);
458 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBINDPARAM
].func
)
459 (StatementHandle
, ParameterNumber
, ValueType
,
460 ParameterScale
, ParameterValue
, StrLen_or_Ind
);
464 /*************************************************************************
465 * SQLCancel [ODBC32.005]
467 SQLRETURN WINAPI
SQLCancel(SQLHSTMT StatementHandle
)
471 CHECK_READY_AND_dmHandle();
473 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCANCEL
].func
);
474 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCANCEL
].func
) (StatementHandle
);
478 /*************************************************************************
479 * SQLCloseCursor [ODBC32.026]
481 SQLRETURN WINAPI
SQLCloseCursor(SQLHSTMT StatementHandle
)
484 TRACE("(Handle=%lx)\n",StatementHandle
);
486 CHECK_READY_AND_dmHandle();
488 assert(gProxyHandle
.functions
[SQLAPI_INDEX_SQLCLOSECURSOR
].func
);
489 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLCLOSECURSOR
].func
) (StatementHandle
);
490 TRACE("returns %d\n",ret
);
495 /*************************************************************************
496 * SQLColAttribute [ODBC32.027]
498 SQLRETURN WINAPI
SQLColAttribute (SQLHSTMT StatementHandle
,
499 SQLUSMALLINT ColumnNumber
, SQLUSMALLINT FieldIdentifier
,
500 SQLPOINTER CharacterAttribute
, SQLSMALLINT BufferLength
,
501 SQLSMALLINT
*StringLength
, SQLPOINTER NumericAttribute
)
505 CHECK_READY_AND_dmHandle();
507 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLATTRIBUTE
].func
);
508 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLATTRIBUTE
].func
)
509 (StatementHandle
, ColumnNumber
, FieldIdentifier
,
510 CharacterAttribute
, BufferLength
, StringLength
, NumericAttribute
);
514 /*************************************************************************
515 * SQLColumns [ODBC32.040]
517 SQLRETURN WINAPI
SQLColumns(SQLHSTMT StatementHandle
,
518 SQLCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
519 SQLCHAR
*SchemaName
, SQLSMALLINT NameLength2
,
520 SQLCHAR
*TableName
, SQLSMALLINT NameLength3
,
521 SQLCHAR
*ColumnName
, SQLSMALLINT NameLength4
)
525 CHECK_READY_AND_dmHandle();
527 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLUMNS
].func
);
528 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLUMNS
].func
)
529 (StatementHandle
, CatalogName
, NameLength1
,
530 SchemaName
, NameLength2
, TableName
, NameLength3
, ColumnName
, NameLength4
);
534 /*************************************************************************
535 * SQLConnect [ODBC32.007]
537 SQLRETURN WINAPI
SQLConnect(SQLHDBC ConnectionHandle
,
538 SQLCHAR
*ServerName
, SQLSMALLINT NameLength1
,
539 SQLCHAR
*UserName
, SQLSMALLINT NameLength2
,
540 SQLCHAR
*Authentication
, SQLSMALLINT NameLength3
)
543 TRACE("(Server=%.*s)\n",NameLength1
, ServerName
);
545 CHECK_READY_AND_dmHandle();
547 strcpy(gProxyHandle
.ServerName
, ServerName
);
548 strcpy(gProxyHandle
.UserName
, UserName
);
550 assert(gProxyHandle
.functions
[SQLAPI_INDEX_SQLCONNECT
].func
);
551 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLCONNECT
].func
)
552 (ConnectionHandle
, ServerName
, NameLength1
,
553 UserName
, NameLength2
, Authentication
, NameLength3
);
555 TRACE("returns %d\n",ret
);
560 /*************************************************************************
561 * SQLCopyDesc [ODBC32.028]
563 SQLRETURN WINAPI
SQLCopyDesc(SQLHDESC SourceDescHandle
, SQLHDESC TargetDescHandle
)
567 CHECK_READY_AND_dmHandle();
569 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOPYDESC
].func
);
570 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOPYDESC
].func
)
571 (SourceDescHandle
, TargetDescHandle
);
575 /*************************************************************************
576 * SQLDataSources [ODBC32.057]
578 SQLRETURN WINAPI
SQLDataSources(SQLHENV EnvironmentHandle
,
579 SQLUSMALLINT Direction
, SQLCHAR
*ServerName
,
580 SQLSMALLINT BufferLength1
, SQLSMALLINT
*NameLength1
,
581 SQLCHAR
*Description
, SQLSMALLINT BufferLength2
,
582 SQLSMALLINT
*NameLength2
)
586 TRACE("EnvironmentHandle = %p\n", (LPVOID
)EnvironmentHandle
);
588 if (!gProxyHandle
.bFunctionReady
|| gProxyHandle
.dmHandle
== NULL
)
590 ERR("Error: empty dm handle (gProxyHandle.dmHandle == NULL)\n");
594 assert(gProxyHandle
.functions
[SQLAPI_INDEX_SQLDATASOURCES
].func
);
595 ret
= (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDATASOURCES
].func
)
596 (EnvironmentHandle
, Direction
, ServerName
,
597 BufferLength1
, NameLength1
, Description
, BufferLength2
, NameLength2
);
601 TRACE("returns: %d \t", ret
);
602 if (*NameLength1
> 0)
603 TRACE("DataSource = %s,", ServerName
);
604 if (*NameLength2
> 0)
605 TRACE(" Description = %s", Description
);
613 /*************************************************************************
614 * SQLDescribeCol [ODBC32.008]
616 SQLRETURN WINAPI
SQLDescribeCol(SQLHSTMT StatementHandle
,
617 SQLUSMALLINT ColumnNumber
, SQLCHAR
*ColumnName
,
618 SQLSMALLINT BufferLength
, SQLSMALLINT
*NameLength
,
619 SQLSMALLINT
*DataType
, SQLUINTEGER
*ColumnSize
,
620 SQLSMALLINT
*DecimalDigits
, SQLSMALLINT
*Nullable
)
624 CHECK_READY_AND_dmHandle();
626 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDESCRIBECOL
].func
);
627 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDESCRIBECOL
].func
)
628 (StatementHandle
, ColumnNumber
, ColumnName
,
629 BufferLength
, NameLength
, DataType
, ColumnSize
, DecimalDigits
, Nullable
);
633 /*************************************************************************
634 * SQLDisconnect [ODBC32.009]
636 SQLRETURN WINAPI
SQLDisconnect(SQLHDBC ConnectionHandle
)
639 TRACE("(Handle=%lx)\n", ConnectionHandle
);
641 CHECK_READY_AND_dmHandle();
643 gProxyHandle
.ServerName
[0] = '\0';
644 gProxyHandle
.UserName
[0] = '\0';
646 assert(gProxyHandle
.functions
[SQLAPI_INDEX_SQLDISCONNECT
].func
);
647 ret
= (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDISCONNECT
].func
) (ConnectionHandle
);
648 TRACE("returns %d\n",ret
);
653 /*************************************************************************
654 * SQLEndTran [ODBC32.029]
656 SQLRETURN WINAPI
SQLEndTran(SQLSMALLINT HandleType
, SQLHANDLE Handle
, SQLSMALLINT CompletionType
)
660 CHECK_READY_AND_dmHandle();
662 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLENDTRAN
].func
);
663 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLENDTRAN
].func
) (HandleType
, Handle
, CompletionType
);
667 /*************************************************************************
668 * SQLError [ODBC32.010]
670 SQLRETURN WINAPI
SQLError(SQLHENV EnvironmentHandle
,
671 SQLHDBC ConnectionHandle
, SQLHSTMT StatementHandle
,
672 SQLCHAR
*Sqlstate
, SQLINTEGER
*NativeError
,
673 SQLCHAR
*MessageText
, SQLSMALLINT BufferLength
,
674 SQLSMALLINT
*TextLength
)
678 CHECK_READY_AND_dmHandle();
680 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLERROR
].func
);
681 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLERROR
].func
)
682 (EnvironmentHandle
, ConnectionHandle
, StatementHandle
,
683 Sqlstate
, NativeError
, MessageText
, BufferLength
, TextLength
);
687 /*************************************************************************
688 * SQLExecDirect [ODBC32.011]
690 SQLRETURN WINAPI
SQLExecDirect(SQLHSTMT StatementHandle
, SQLCHAR
*StatementText
, SQLINTEGER TextLength
)
694 CHECK_READY_AND_dmHandle();
696 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLEXECDIRECT
].func
);
697 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLEXECDIRECT
].func
)
698 (StatementHandle
, StatementText
, TextLength
);
702 /*************************************************************************
703 * SQLExecute [ODBC32.012]
705 SQLRETURN WINAPI
SQLExecute(SQLHSTMT StatementHandle
)
709 CHECK_READY_AND_dmHandle();
711 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLEXECUTE
].func
);
712 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLEXECUTE
].func
) (StatementHandle
);
716 /*************************************************************************
717 * SQLFetch [ODBC32.013]
719 SQLRETURN WINAPI
SQLFetch(SQLHSTMT StatementHandle
)
723 CHECK_READY_AND_dmHandle();
725 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFETCH
].func
);
726 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFETCH
].func
) (StatementHandle
);
730 /*************************************************************************
731 * SQLFetchScroll [ODBC32.030]
733 SQLRETURN WINAPI
SQLFetchScroll(SQLHSTMT StatementHandle
, SQLSMALLINT FetchOrientation
, SQLINTEGER FetchOffset
)
739 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFETCHSCROLL
].func
);
740 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFETCHSCROLL
].func
)
741 (StatementHandle
, FetchOrientation
, FetchOffset
);
745 /*************************************************************************
746 * SQLFreeConnect [ODBC32.014]
748 SQLRETURN WINAPI
SQLFreeConnect(SQLHDBC ConnectionHandle
)
751 TRACE("(Handle=%lx)\n",ConnectionHandle
);
755 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREECONNECT
].func
);
756 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREECONNECT
].func
) (ConnectionHandle
);
757 TRACE("Returns %d\n",ret
);
762 /*************************************************************************
763 * SQLFreeEnv [ODBC32.015]
765 SQLRETURN WINAPI
SQLFreeEnv(SQLHENV EnvironmentHandle
)
768 TRACE("(Env=%lx)\n",EnvironmentHandle
);
772 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREEENV
].func
);
773 ret
= (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREEENV
].func
) (EnvironmentHandle
);
774 TRACE("Returns %d\n",ret
);
779 /*************************************************************************
780 * SQLFreeHandle [ODBC32.031]
782 SQLRETURN WINAPI
SQLFreeHandle(SQLSMALLINT HandleType
, SQLHANDLE Handle
)
785 TRACE("(Type=%d, Handle=%lx)\n",HandleType
,Handle
);
789 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREEHANDLE
].func
);
790 ret
= (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREEHANDLE
].func
)
791 (HandleType
, Handle
);
792 TRACE ("Returns %d\n",ret
);
797 /*************************************************************************
798 * SQLFreeStmt [ODBC32.016]
800 SQLRETURN WINAPI
SQLFreeStmt(SQLHSTMT StatementHandle
, SQLUSMALLINT Option
)
803 TRACE("(Handle %lx, Option=%d)\n",StatementHandle
, Option
);
807 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREESTMT
].func
);
808 ret
=(gProxyHandle
.functions
[SQLAPI_INDEX_SQLFREESTMT
].func
)
809 (StatementHandle
, Option
);
810 TRACE("Returns %d\n",ret
);
815 /*************************************************************************
816 * SQLGetConnectAttr [ODBC32.032]
818 SQLRETURN WINAPI
SQLGetConnectAttr(SQLHDBC ConnectionHandle
,
819 SQLINTEGER Attribute
, SQLPOINTER Value
,
820 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
826 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETCONNECTATTR
].func
);
827 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETCONNECTATTR
].func
)
828 (ConnectionHandle
, Attribute
, Value
,
829 BufferLength
, StringLength
);
833 /*************************************************************************
834 * SQLGetConnectOption [ODBC32.042]
836 SQLRETURN WINAPI
SQLGetConnectOption(SQLHDBC ConnectionHandle
, SQLUSMALLINT Option
, SQLPOINTER Value
)
842 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETCONNECTOPTION
].func
);
843 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETCONNECTOPTION
].func
)
844 (ConnectionHandle
, Option
, Value
);
848 /*************************************************************************
849 * SQLGetCursorName [ODBC32.017]
851 SQLRETURN WINAPI
SQLGetCursorName(SQLHSTMT StatementHandle
,
852 SQLCHAR
*CursorName
, SQLSMALLINT BufferLength
,
853 SQLSMALLINT
*NameLength
)
859 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETCURSORNAME
].func
);
860 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETCURSORNAME
].func
)
861 (StatementHandle
, CursorName
, BufferLength
, NameLength
);
865 /*************************************************************************
866 * SQLGetData [ODBC32.043]
868 SQLRETURN WINAPI
SQLGetData(SQLHSTMT StatementHandle
,
869 SQLUSMALLINT ColumnNumber
, SQLSMALLINT TargetType
,
870 SQLPOINTER TargetValue
, SQLINTEGER BufferLength
,
871 SQLINTEGER
*StrLen_or_Ind
)
877 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDATA
].func
);
878 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDATA
].func
)
879 (StatementHandle
, ColumnNumber
, TargetType
,
880 TargetValue
, BufferLength
, StrLen_or_Ind
);
884 /*************************************************************************
885 * SQLGetDescField [ODBC32.033]
887 SQLRETURN WINAPI
SQLGetDescField(SQLHDESC DescriptorHandle
,
888 SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
889 SQLPOINTER Value
, SQLINTEGER BufferLength
,
890 SQLINTEGER
*StringLength
)
896 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDESCFIELD
].func
);
897 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDESCFIELD
].func
)
898 (DescriptorHandle
, RecNumber
, FieldIdentifier
,
899 Value
, BufferLength
, StringLength
);
903 /*************************************************************************
904 * SQLGetDescRec [ODBC32.034]
906 SQLRETURN WINAPI
SQLGetDescRec(SQLHDESC DescriptorHandle
,
907 SQLSMALLINT RecNumber
, SQLCHAR
*Name
,
908 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
,
909 SQLSMALLINT
*Type
, SQLSMALLINT
*SubType
,
910 SQLINTEGER
*Length
, SQLSMALLINT
*Precision
,
911 SQLSMALLINT
*Scale
, SQLSMALLINT
*Nullable
)
917 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDESCREC
].func
);
918 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDESCREC
].func
)
919 (DescriptorHandle
, RecNumber
, Name
, BufferLength
,
920 StringLength
, Type
, SubType
, Length
, Precision
, Scale
, Nullable
);
924 /*************************************************************************
925 * SQLGetDiagField [ODBC32.035]
927 SQLRETURN WINAPI
SQLGetDiagField(SQLSMALLINT HandleType
, SQLHANDLE Handle
,
928 SQLSMALLINT RecNumber
, SQLSMALLINT DiagIdentifier
,
929 SQLPOINTER DiagInfo
, SQLSMALLINT BufferLength
,
930 SQLSMALLINT
*StringLength
)
936 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDIAGFIELD
].func
);
937 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDIAGFIELD
].func
)
938 (HandleType
, Handle
, RecNumber
, DiagIdentifier
,
939 DiagInfo
, BufferLength
, StringLength
);
943 /*************************************************************************
944 * SQLGetDiagRec [ODBC32.036]
946 SQLRETURN WINAPI
SQLGetDiagRec(SQLSMALLINT HandleType
, SQLHANDLE Handle
,
947 SQLSMALLINT RecNumber
, SQLCHAR
*Sqlstate
,
948 SQLINTEGER
*NativeError
, SQLCHAR
*MessageText
,
949 SQLSMALLINT BufferLength
, SQLSMALLINT
*TextLength
)
955 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDIAGREC
].func
);
956 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETDIAGREC
].func
)
957 (HandleType
, Handle
, RecNumber
, Sqlstate
, NativeError
,
958 MessageText
, BufferLength
, TextLength
);
962 /*************************************************************************
963 * SQLGetEnvAttr [ODBC32.037]
965 SQLRETURN WINAPI
SQLGetEnvAttr(SQLHENV EnvironmentHandle
,
966 SQLINTEGER Attribute
, SQLPOINTER Value
,
967 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
973 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETENVATTR
].func
);
974 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETENVATTR
].func
)
975 (EnvironmentHandle
, Attribute
, Value
, BufferLength
, StringLength
);
979 /*************************************************************************
980 * SQLGetFunctions [ODBC32.044]
982 SQLRETURN WINAPI
SQLGetFunctions(SQLHDBC ConnectionHandle
, SQLUSMALLINT FunctionId
, SQLUSMALLINT
*Supported
)
988 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETFUNCTIONS
].func
);
989 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETFUNCTIONS
].func
)
990 (ConnectionHandle
, FunctionId
, Supported
);
994 /*************************************************************************
995 * SQLGetInfo [ODBC32.045]
997 SQLRETURN WINAPI
SQLGetInfo(SQLHDBC ConnectionHandle
,
998 SQLUSMALLINT InfoType
, SQLPOINTER InfoValue
,
999 SQLSMALLINT BufferLength
, SQLSMALLINT
*StringLength
)
1005 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETINFO
].func
);
1006 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETINFO
].func
)
1007 (ConnectionHandle
, InfoType
, InfoValue
, BufferLength
, StringLength
);
1011 /*************************************************************************
1012 * SQLGetStmtAttr [ODBC32.038]
1014 SQLRETURN WINAPI
SQLGetStmtAttr(SQLHSTMT StatementHandle
,
1015 SQLINTEGER Attribute
, SQLPOINTER Value
,
1016 SQLINTEGER BufferLength
, SQLINTEGER
*StringLength
)
1022 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETSTMTATTR
].func
);
1023 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETSTMTATTR
].func
)
1024 (StatementHandle
, Attribute
, Value
, BufferLength
, StringLength
);
1028 /*************************************************************************
1029 * SQLGetStmtOption [ODBC32.046]
1031 SQLRETURN WINAPI
SQLGetStmtOption(SQLHSTMT StatementHandle
, SQLUSMALLINT Option
, SQLPOINTER Value
)
1037 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETSTMTOPTION
].func
);
1038 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETSTMTOPTION
].func
)
1039 (StatementHandle
, Option
, Value
);
1043 /*************************************************************************
1044 * SQLGetTypeInfo [ODBC32.047]
1046 SQLRETURN WINAPI
SQLGetTypeInfo(SQLHSTMT StatementHandle
, SQLSMALLINT DataType
)
1052 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETTYPEINFO
].func
);
1053 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLGETTYPEINFO
].func
)
1054 (StatementHandle
, DataType
);
1058 /*************************************************************************
1059 * SQLNumResultCols [ODBC32.018]
1061 SQLRETURN WINAPI
SQLNumResultCols(SQLHSTMT StatementHandle
, SQLSMALLINT
*ColumnCount
)
1067 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLNUMRESULTCOLS
].func
);
1068 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLNUMRESULTCOLS
].func
)
1069 (StatementHandle
, ColumnCount
);
1073 /*************************************************************************
1074 * SQLParamData [ODBC32.048]
1076 SQLRETURN WINAPI
SQLParamData(SQLHSTMT StatementHandle
, SQLPOINTER
*Value
)
1082 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPARAMDATA
].func
);
1083 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPARAMDATA
].func
)
1084 (StatementHandle
, Value
);
1088 /*************************************************************************
1089 * SQLPrepare [ODBC32.019]
1091 SQLRETURN WINAPI
SQLPrepare(SQLHSTMT StatementHandle
, SQLCHAR
*StatementText
, SQLINTEGER TextLength
)
1097 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPREPARE
].func
);
1098 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPREPARE
].func
)
1099 (StatementHandle
, StatementText
, TextLength
);
1103 /*************************************************************************
1104 * SQLPutData [ODBC32.049]
1106 SQLRETURN WINAPI
SQLPutData(SQLHSTMT StatementHandle
, SQLPOINTER Data
, SQLINTEGER StrLen_or_Ind
)
1112 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPUTDATA
].func
);
1113 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPUTDATA
].func
)
1114 (StatementHandle
, Data
, StrLen_or_Ind
);
1118 /*************************************************************************
1119 * SQLRowCount [ODBC32.020]
1121 SQLRETURN WINAPI
SQLRowCount(SQLHSTMT StatementHandle
, SQLINTEGER
*RowCount
)
1127 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLROWCOUNT
].func
);
1128 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLROWCOUNT
].func
)
1129 (StatementHandle
, RowCount
);
1133 /*************************************************************************
1134 * SQLSetConnectAttr [ODBC32.039]
1136 SQLRETURN WINAPI
SQLSetConnectAttr(SQLHDBC ConnectionHandle
, SQLINTEGER Attribute
,
1137 SQLPOINTER Value
, SQLINTEGER StringLength
)
1143 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETCONNECTATTR
].func
);
1144 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETCONNECTATTR
].func
)
1145 (ConnectionHandle
, Attribute
, Value
, StringLength
);
1149 /*************************************************************************
1150 * SQLSetConnectOption [ODBC32.050]
1152 SQLRETURN WINAPI
SQLSetConnectOption(SQLHDBC ConnectionHandle
, SQLUSMALLINT Option
, SQLUINTEGER Value
)
1158 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETCONNECTOPTION
].func
);
1159 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETCONNECTOPTION
].func
)
1160 (ConnectionHandle
, Option
, Value
);
1164 /*************************************************************************
1165 * SQLSetCursorName [ODBC32.021]
1167 SQLRETURN WINAPI
SQLSetCursorName(SQLHSTMT StatementHandle
, SQLCHAR
*CursorName
, SQLSMALLINT NameLength
)
1173 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETCURSORNAME
].func
);
1174 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETCURSORNAME
].func
)
1175 (StatementHandle
, CursorName
, NameLength
);
1179 /*************************************************************************
1180 * SQLSetDescField [ODBC32.073]
1182 SQLRETURN WINAPI
SQLSetDescField(SQLHDESC DescriptorHandle
,
1183 SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
1184 SQLPOINTER Value
, SQLINTEGER BufferLength
)
1190 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETDESCFIELD
].func
);
1191 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETDESCFIELD
].func
)
1192 (DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
, BufferLength
);
1196 /*************************************************************************
1197 * SQLSetDescRec [ODBC32.074]
1199 SQLRETURN WINAPI
SQLSetDescRec(SQLHDESC DescriptorHandle
,
1200 SQLSMALLINT RecNumber
, SQLSMALLINT Type
,
1201 SQLSMALLINT SubType
, SQLINTEGER Length
,
1202 SQLSMALLINT Precision
, SQLSMALLINT Scale
,
1203 SQLPOINTER Data
, SQLINTEGER
*StringLength
,
1204 SQLINTEGER
*Indicator
)
1210 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETDESCREC
].func
);
1211 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETDESCREC
].func
)
1212 (DescriptorHandle
, RecNumber
, Type
, SubType
, Length
,
1213 Precision
, Scale
, Data
, StringLength
, Indicator
);
1217 /*************************************************************************
1218 * SQLSetEnvAttr [ODBC32.075]
1220 SQLRETURN WINAPI
SQLSetEnvAttr(SQLHENV EnvironmentHandle
,
1221 SQLINTEGER Attribute
, SQLPOINTER Value
,
1222 SQLINTEGER StringLength
)
1228 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETENVATTR
].func
);
1229 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETENVATTR
].func
)
1230 (EnvironmentHandle
, Attribute
, Value
, StringLength
);
1234 /*************************************************************************
1235 * SQLSetParam [ODBC32.022]
1237 SQLRETURN WINAPI
SQLSetParam(SQLHSTMT StatementHandle
,
1238 SQLUSMALLINT ParameterNumber
, SQLSMALLINT ValueType
,
1239 SQLSMALLINT ParameterType
, SQLUINTEGER LengthPrecision
,
1240 SQLSMALLINT ParameterScale
, SQLPOINTER ParameterValue
,
1241 SQLINTEGER
*StrLen_or_Ind
)
1247 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETPARAM
].func
);
1248 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETPARAM
].func
)
1249 (StatementHandle
, ParameterNumber
, ValueType
, ParameterType
, LengthPrecision
,
1250 ParameterScale
, ParameterValue
, StrLen_or_Ind
);
1254 /*************************************************************************
1255 * SQLSetStmtAttr [ODBC32.076]
1257 SQLRETURN WINAPI
SQLSetStmtAttr(SQLHSTMT StatementHandle
,
1258 SQLINTEGER Attribute
, SQLPOINTER Value
,
1259 SQLINTEGER StringLength
)
1265 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETSTMTATTR
].func
);
1266 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETSTMTATTR
].func
)
1267 (StatementHandle
, Attribute
, Value
, StringLength
);
1271 /*************************************************************************
1272 * SQLSetStmtOption [ODBC32.051]
1274 SQLRETURN WINAPI
SQLSetStmtOption(SQLHSTMT StatementHandle
, SQLUSMALLINT Option
, SQLUINTEGER Value
)
1280 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETSTMTOPTION
].func
);
1281 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETSTMTOPTION
].func
)
1282 (StatementHandle
, Option
, Value
);
1286 /*************************************************************************
1287 * SQLSpecialColumns [ODBC32.052]
1289 SQLRETURN WINAPI
SQLSpecialColumns(SQLHSTMT StatementHandle
,
1290 SQLUSMALLINT IdentifierType
, SQLCHAR
*CatalogName
,
1291 SQLSMALLINT NameLength1
, SQLCHAR
*SchemaName
,
1292 SQLSMALLINT NameLength2
, SQLCHAR
*TableName
,
1293 SQLSMALLINT NameLength3
, SQLUSMALLINT Scope
,
1294 SQLUSMALLINT Nullable
)
1299 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSPECIALCOLUMNS
].func
);
1300 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSPECIALCOLUMNS
].func
)
1301 (StatementHandle
, IdentifierType
, CatalogName
, NameLength1
, SchemaName
,
1302 NameLength2
, TableName
, NameLength3
, Scope
, Nullable
);
1306 /*************************************************************************
1307 * SQLStatistics [ODBC32.053]
1309 SQLRETURN WINAPI
SQLStatistics(SQLHSTMT StatementHandle
,
1310 SQLCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
1311 SQLCHAR
*SchemaName
, SQLSMALLINT NameLength2
,
1312 SQLCHAR
*TableName
, SQLSMALLINT NameLength3
,
1313 SQLUSMALLINT Unique
, SQLUSMALLINT Reserved
)
1319 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSTATISTICS
].func
);
1320 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSTATISTICS
].func
)
1321 (StatementHandle
, CatalogName
, NameLength1
, SchemaName
, NameLength2
,
1322 TableName
, NameLength3
, Unique
, Reserved
);
1326 /*************************************************************************
1327 * SQLTables [ODBC32.054]
1329 SQLRETURN WINAPI
SQLTables(SQLHSTMT StatementHandle
,
1330 SQLCHAR
*CatalogName
, SQLSMALLINT NameLength1
,
1331 SQLCHAR
*SchemaName
, SQLSMALLINT NameLength2
,
1332 SQLCHAR
*TableName
, SQLSMALLINT NameLength3
,
1333 SQLCHAR
*TableType
, SQLSMALLINT NameLength4
)
1339 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLTABLES
].func
);
1340 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLTABLES
].func
)
1341 (StatementHandle
, CatalogName
, NameLength1
,
1342 SchemaName
, NameLength2
, TableName
, NameLength3
, TableType
, NameLength4
);
1346 /*************************************************************************
1347 * SQLTransact [ODBC32.023]
1349 SQLRETURN WINAPI
SQLTransact(SQLHENV EnvironmentHandle
, SQLHDBC ConnectionHandle
,
1350 SQLUSMALLINT CompletionType
)
1356 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLTRANSACT
].func
);
1357 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLTRANSACT
].func
)
1358 (EnvironmentHandle
, ConnectionHandle
, CompletionType
);
1362 /*************************************************************************
1363 * SQLBrowseConnect [ODBC32.055]
1365 SQLRETURN WINAPI
SQLBrowseConnect(
1367 SQLCHAR
*szConnStrIn
,
1368 SQLSMALLINT cbConnStrIn
,
1369 SQLCHAR
*szConnStrOut
,
1370 SQLSMALLINT cbConnStrOutMax
,
1371 SQLSMALLINT
*pcbConnStrOut
)
1377 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBROWSECONNECT
].func
);
1378 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBROWSECONNECT
].func
)
1379 (hdbc
, szConnStrIn
, cbConnStrIn
, szConnStrOut
, cbConnStrOutMax
, pcbConnStrOut
);
1383 /*************************************************************************
1384 * SQLBulkOperations [ODBC32.078]
1386 SQLRETURN WINAPI
SQLBulkOperations(
1387 SQLHSTMT StatementHandle
,
1388 SQLSMALLINT Operation
)
1394 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBULKOPERATIONS
].func
);
1395 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBULKOPERATIONS
].func
)
1396 (StatementHandle
, Operation
);
1400 /*************************************************************************
1401 * SQLColAttributes [ODBC32.006]
1403 SQLRETURN WINAPI
SQLColAttributes(
1406 SQLUSMALLINT fDescType
,
1408 SQLSMALLINT cbDescMax
,
1409 SQLSMALLINT
*pcbDesc
,
1416 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLATTRIBUTES
].func
);
1417 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLATTRIBUTES
].func
)
1418 (hstmt
, icol
, fDescType
, rgbDesc
, cbDescMax
, pcbDesc
, pfDesc
);
1422 /*************************************************************************
1423 * SQLColumnPrivileges [ODBC32.056]
1425 SQLRETURN WINAPI
SQLColumnPrivileges(
1427 SQLCHAR
*szCatalogName
,
1428 SQLSMALLINT cbCatalogName
,
1429 SQLCHAR
*szSchemaName
,
1430 SQLSMALLINT cbSchemaName
,
1431 SQLCHAR
*szTableName
,
1432 SQLSMALLINT cbTableName
,
1433 SQLCHAR
*szColumnName
,
1434 SQLSMALLINT cbColumnName
)
1440 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLUMNPRIVILEGES
].func
);
1441 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLCOLUMNPRIVILEGES
].func
)
1442 (hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
, cbSchemaName
,
1443 szTableName
, cbTableName
, szColumnName
, cbColumnName
);
1447 /*************************************************************************
1448 * SQLDescribeParam [ODBC32.058]
1450 SQLRETURN WINAPI
SQLDescribeParam(
1453 SQLSMALLINT
*pfSqlType
,
1454 SQLUINTEGER
*pcbParamDef
,
1455 SQLSMALLINT
*pibScale
,
1456 SQLSMALLINT
*pfNullable
)
1462 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDESCRIBEPARAM
].func
);
1463 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDESCRIBEPARAM
].func
)
1464 (hstmt
, ipar
, pfSqlType
, pcbParamDef
, pibScale
, pfNullable
);
1468 /*************************************************************************
1469 * SQLExtendedFetch [ODBC32.059]
1471 SQLRETURN WINAPI
SQLExtendedFetch(
1473 SQLUSMALLINT fFetchType
,
1476 SQLUSMALLINT
*rgfRowStatus
)
1482 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLEXTENDEDFETCH
].func
);
1483 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLEXTENDEDFETCH
].func
)
1484 (hstmt
, fFetchType
, irow
, pcrow
, rgfRowStatus
);
1488 /*************************************************************************
1489 * SQLForeignKeys [ODBC32.060]
1491 SQLRETURN WINAPI
SQLForeignKeys(
1493 SQLCHAR
*szPkCatalogName
,
1494 SQLSMALLINT cbPkCatalogName
,
1495 SQLCHAR
*szPkSchemaName
,
1496 SQLSMALLINT cbPkSchemaName
,
1497 SQLCHAR
*szPkTableName
,
1498 SQLSMALLINT cbPkTableName
,
1499 SQLCHAR
*szFkCatalogName
,
1500 SQLSMALLINT cbFkCatalogName
,
1501 SQLCHAR
*szFkSchemaName
,
1502 SQLSMALLINT cbFkSchemaName
,
1503 SQLCHAR
*szFkTableName
,
1504 SQLSMALLINT cbFkTableName
)
1510 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFOREIGNKEYS
].func
);
1511 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLFOREIGNKEYS
].func
)
1512 (hstmt
, szPkCatalogName
, cbPkCatalogName
, szPkSchemaName
, cbPkSchemaName
,
1513 szPkTableName
, cbPkTableName
, szFkCatalogName
, cbFkCatalogName
, szFkSchemaName
,
1514 cbFkSchemaName
, szFkTableName
, cbFkTableName
);
1518 /*************************************************************************
1519 * SQLMoreResults [ODBC32.061]
1521 SQLRETURN WINAPI
SQLMoreResults(SQLHSTMT hstmt
)
1527 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLMORERESULTS
].func
);
1528 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLMORERESULTS
].func
) (hstmt
);
1532 /*************************************************************************
1533 * SQLNativeSql [ODBC32.062]
1535 SQLRETURN WINAPI
SQLNativeSql(
1537 SQLCHAR
*szSqlStrIn
,
1538 SQLINTEGER cbSqlStrIn
,
1540 SQLINTEGER cbSqlStrMax
,
1541 SQLINTEGER
*pcbSqlStr
)
1547 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLNATIVESQL
].func
);
1548 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLNATIVESQL
].func
)
1549 (hdbc
, szSqlStrIn
, cbSqlStrIn
, szSqlStr
, cbSqlStrMax
, pcbSqlStr
);
1553 /*************************************************************************
1554 * SQLNumParams [ODBC32.063]
1556 SQLRETURN WINAPI
SQLNumParams(
1564 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLNUMPARAMS
].func
);
1565 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLNUMPARAMS
].func
) (hstmt
, pcpar
);
1569 /*************************************************************************
1570 * SQLParamOptions [ODBC32.064]
1572 SQLRETURN WINAPI
SQLParamOptions(
1581 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPARAMOPTIONS
].func
);
1582 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPARAMOPTIONS
].func
) (hstmt
, crow
, pirow
);
1586 /*************************************************************************
1587 * SQLPrimaryKeys [ODBC32.065]
1589 SQLRETURN WINAPI
SQLPrimaryKeys(
1591 SQLCHAR
*szCatalogName
,
1592 SQLSMALLINT cbCatalogName
,
1593 SQLCHAR
*szSchemaName
,
1594 SQLSMALLINT cbSchemaName
,
1595 SQLCHAR
*szTableName
,
1596 SQLSMALLINT cbTableName
)
1602 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPRIMARYKEYS
].func
);
1603 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPRIMARYKEYS
].func
)
1604 (hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
, cbSchemaName
,
1605 szTableName
, cbTableName
);
1609 /*************************************************************************
1610 * SQLProcedureColumns [ODBC32.066]
1612 SQLRETURN WINAPI
SQLProcedureColumns(
1614 SQLCHAR
*szCatalogName
,
1615 SQLSMALLINT cbCatalogName
,
1616 SQLCHAR
*szSchemaName
,
1617 SQLSMALLINT cbSchemaName
,
1618 SQLCHAR
*szProcName
,
1619 SQLSMALLINT cbProcName
,
1620 SQLCHAR
*szColumnName
,
1621 SQLSMALLINT cbColumnName
)
1627 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPROCEDURECOLUMNS
].func
);
1628 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPROCEDURECOLUMNS
].func
)
1629 (hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
, cbSchemaName
,
1630 szProcName
, cbProcName
, szColumnName
, cbColumnName
);
1634 /*************************************************************************
1635 * SQLProcedures [ODBC32.067]
1637 SQLRETURN WINAPI
SQLProcedures(
1639 SQLCHAR
*szCatalogName
,
1640 SQLSMALLINT cbCatalogName
,
1641 SQLCHAR
*szSchemaName
,
1642 SQLSMALLINT cbSchemaName
,
1643 SQLCHAR
*szProcName
,
1644 SQLSMALLINT cbProcName
)
1650 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPROCEDURES
].func
);
1651 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLPROCEDURES
].func
)
1652 (hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
, cbSchemaName
,
1653 szProcName
, cbProcName
);
1657 /*************************************************************************
1658 * SQLSetPos [ODBC32.068]
1660 SQLRETURN WINAPI
SQLSetPos(
1663 SQLUSMALLINT fOption
,
1670 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETPOS
].func
);
1671 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETPOS
].func
)
1672 (hstmt
, irow
, fOption
, fLock
);
1676 /*************************************************************************
1677 * SQLTablePrivileges [ODBC32.070]
1679 SQLRETURN WINAPI
SQLTablePrivileges(
1681 SQLCHAR
*szCatalogName
,
1682 SQLSMALLINT cbCatalogName
,
1683 SQLCHAR
*szSchemaName
,
1684 SQLSMALLINT cbSchemaName
,
1685 SQLCHAR
*szTableName
,
1686 SQLSMALLINT cbTableName
)
1692 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLTABLEPRIVILEGES
].func
);
1693 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLTABLEPRIVILEGES
].func
)
1694 (hstmt
, szCatalogName
, cbCatalogName
, szSchemaName
, cbSchemaName
,
1695 szTableName
, cbTableName
);
1699 /*************************************************************************
1700 * SQLDrivers [ODBC32.071]
1702 SQLRETURN WINAPI
SQLDrivers(
1704 SQLUSMALLINT fDirection
,
1705 SQLCHAR
*szDriverDesc
,
1706 SQLSMALLINT cbDriverDescMax
,
1707 SQLSMALLINT
*pcbDriverDesc
,
1708 SQLCHAR
*szDriverAttributes
,
1709 SQLSMALLINT cbDriverAttrMax
,
1710 SQLSMALLINT
*pcbDriverAttr
)
1716 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDRIVERS
].func
);
1717 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDRIVERS
].func
)
1718 (henv
, fDirection
, szDriverDesc
, cbDriverDescMax
, pcbDriverDesc
,
1719 szDriverAttributes
, cbDriverAttrMax
, pcbDriverAttr
);
1723 /*************************************************************************
1724 * SQLBindParameter [ODBC32.072]
1726 SQLRETURN WINAPI
SQLBindParameter(
1729 SQLSMALLINT fParamType
,
1731 SQLSMALLINT fSqlType
,
1732 SQLUINTEGER cbColDef
,
1733 SQLSMALLINT ibScale
,
1734 SQLPOINTER rgbValue
,
1735 SQLINTEGER cbValueMax
,
1736 SQLINTEGER
*pcbValue
)
1742 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBINDPARAMETER
].func
);
1743 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLBINDPARAMETER
].func
)
1744 (hstmt
, ipar
, fParamType
, fCType
, fSqlType
, cbColDef
, ibScale
,
1745 rgbValue
, cbValueMax
, pcbValue
);
1749 /*************************************************************************
1750 * SQLDriverConnect [ODBC32.041]
1752 SQLRETURN WINAPI
SQLDriverConnect(
1755 SQLCHAR
*conn_str_in
,
1756 SQLSMALLINT len_conn_str_in
,
1757 SQLCHAR
*conn_str_out
,
1758 SQLSMALLINT conn_str_out_max
,
1759 SQLSMALLINT
*ptr_conn_str_out
,
1760 SQLUSMALLINT driver_completion
)
1766 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDRIVERCONNECT
].func
);
1767 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLDRIVERCONNECT
].func
)
1768 (hdbc
, hwnd
, conn_str_in
, len_conn_str_in
, conn_str_out
,
1769 conn_str_out_max
, ptr_conn_str_out
, driver_completion
);
1773 /*************************************************************************
1774 * SQLSetScrollOptions [ODBC32.069]
1776 SQLRETURN WINAPI
SQLSetScrollOptions(
1777 SQLHSTMT statement_handle
,
1778 SQLUSMALLINT f_concurrency
,
1779 SQLINTEGER crow_keyset
,
1780 SQLUSMALLINT crow_rowset
)
1786 assert (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETSCROLLOPTIONS
].func
);
1787 return (gProxyHandle
.functions
[SQLAPI_INDEX_SQLSETSCROLLOPTIONS
].func
)
1788 (statement_handle
, f_concurrency
, crow_keyset
, crow_rowset
);