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 * Xiang Li, Corel Corporation, Nov. 12, 1999
18 #include "debugtools.h"
24 #include "proxyodbc.h"
26 DEFAULT_DEBUG_CHANNEL(odbc);
28 static const DM_FUNC template_func[] =
30 /* 00 */ { SQL_API_SQLALLOCCONNECT, "SQLAllocConnect", SQLAllocConnect, NULL },
31 /* 01 */ { SQL_API_SQLALLOCENV, "SQLAllocEnv", SQLAllocEnv, NULL },
32 /* 02 */ { SQL_API_SQLALLOCHANDLE, "SQLAllocHandle", SQLAllocHandle, NULL },
33 /* 03 */ { SQL_API_SQLALLOCSTMT, "SQLAllocStmt", SQLAllocStmt, NULL },
34 /* 04 */ { SQL_API_SQLALLOCHANDLESTD, "SQLAllocHandleStd", SQLAllocHandleStd, NULL },
35 /* 05 */ { SQL_API_SQLBINDCOL, "SQLBindCol", SQLBindCol, NULL },
36 /* 06 */ { SQL_API_SQLBINDPARAM, "SQLBindParam", SQLBindParam, NULL },
37 /* 07 */ { SQL_API_SQLBINDPARAMETER, "SQLBindParameter", SQLBindParameter, NULL },
38 /* 08 */ { SQL_API_SQLBROWSECONNECT, "SQLBrowseConnect", SQLBrowseConnect, NULL },
39 /* 09 */ { SQL_API_SQLBULKOPERATIONS, "SQLBulkOperations", SQLBulkOperations, NULL },
40 /* 10 */ { SQL_API_SQLCANCEL, "SQLCancel", SQLCancel, NULL },
41 /* 11 */ { SQL_API_SQLCLOSECURSOR, "SQLCloseCursor", SQLCloseCursor, NULL },
42 /* 12 */ { SQL_API_SQLCOLATTRIBUTE, "SQLColAttribute", SQLColAttribute, NULL },
43 /* 13 */ { SQL_API_SQLCOLATTRIBUTES, "SQLColAttributes", SQLColAttributes, NULL },
44 /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES, "SQLColumnPrivileges", SQLColumnPrivileges, NULL },
45 /* 15 */ { SQL_API_SQLCOLUMNS, "SQLColumns", SQLColumns, NULL },
46 /* 16 */ { SQL_API_SQLCONNECT, "SQLConnect", SQLConnect, NULL },
47 /* 17 */ { SQL_API_SQLCOPYDESC, "SQLCopyDesc", SQLCopyDesc, NULL },
48 /* 18 */ { SQL_API_SQLDATASOURCES, "SQLDataSources", SQLDataSources, NULL },
49 /* 19 */ { SQL_API_SQLDESCRIBECOL, "SQLDescribeCol", SQLDescribeCol, NULL },
50 /* 20 */ { SQL_API_SQLDESCRIBEPARAM, "SQLDescribeParam", SQLDescribeParam, NULL },
51 /* 21 */ { SQL_API_SQLDISCONNECT, "SQLDisconnect", SQLDisconnect, NULL },
52 /* 22 */ { SQL_API_SQLDRIVERCONNECT, "SQLDriverConnect", SQLDriverConnect, NULL },
53 /* 23 */ { SQL_API_SQLDRIVERS, "SQLDrivers", SQLDrivers, NULL },
54 /* 24 */ { SQL_API_SQLENDTRAN, "SQLEndTran", SQLEndTran, NULL },
55 /* 25 */ { SQL_API_SQLERROR, "SQLError", SQLError, NULL },
56 /* 26 */ { SQL_API_SQLEXECDIRECT, "SQLExecDirect", SQLExecDirect, NULL },
57 /* 27 */ { SQL_API_SQLEXECUTE, "SQLExecute", SQLExecute, NULL },
58 /* 28 */ { SQL_API_SQLEXTENDEDFETCH, "SQLExtendedFetch", SQLExtendedFetch, NULL },
59 /* 29 */ { SQL_API_SQLFETCH, "SQLFetch", SQLFetch, NULL },
60 /* 30 */ { SQL_API_SQLFETCHSCROLL, "SQLFetchScroll", SQLFetchScroll, NULL },
61 /* 31 */ { SQL_API_SQLFOREIGNKEYS, "SQLForeignKeys", SQLForeignKeys, NULL },
62 /* 32 */ { SQL_API_SQLFREEENV, "SQLFreeEnv", SQLFreeEnv, NULL },
63 /* 33 */ { SQL_API_SQLFREEHANDLE, "SQLFreeHandle", SQLFreeHandle, NULL },
64 /* 34 */ { SQL_API_SQLFREESTMT, "SQLFreeStmt", SQLFreeStmt, NULL },
65 /* 35 */ { SQL_API_SQLFREECONNECT, "SQLFreeConnect", SQLFreeConnect, NULL },
66 /* 36 */ { SQL_API_SQLGETCONNECTATTR, "SQLGetConnectAttr", SQLGetConnectAttr, NULL },
67 /* 37 */ { SQL_API_SQLGETCONNECTOPTION, "SQLGetConnectOption", SQLGetConnectOption, NULL },
68 /* 38 */ { SQL_API_SQLGETCURSORNAME, "SQLGetCursorName", SQLGetCursorName, NULL },
69 /* 39 */ { SQL_API_SQLGETDATA, "SQLGetData", SQLGetData, NULL },
70 /* 40 */ { SQL_API_SQLGETDESCFIELD, "SQLGetDescField", SQLGetDescField, NULL },
71 /* 41 */ { SQL_API_SQLGETDESCREC, "SQLGetDescRec", SQLGetDescRec, NULL },
72 /* 42 */ { SQL_API_SQLGETDIAGFIELD, "SQLGetDiagField", SQLGetDiagField, NULL },
73 /* 43 */ { SQL_API_SQLGETENVATTR, "SQLGetEnvAttr", SQLGetEnvAttr, NULL },
74 /* 44 */ { SQL_API_SQLGETFUNCTIONS, "SQLGetFunctions", SQLGetFunctions, NULL },
75 /* 45 */ { SQL_API_SQLGETINFO, "SQLGetInfo", SQLGetInfo, NULL },
76 /* 46 */ { SQL_API_SQLGETSTMTATTR, "SQLGetStmtAttr", SQLGetStmtAttr, NULL },
77 /* 47 */ { SQL_API_SQLGETSTMTOPTION, "SQLGetStmtOption", SQLGetStmtOption, NULL },
78 /* 48 */ { SQL_API_SQLGETTYPEINFO, "SQLGetTypeInfo", SQLGetTypeInfo, NULL },
79 /* 49 */ { SQL_API_SQLMORERESULTS, "SQLMoreResults", SQLMoreResults, NULL },
80 /* 50 */ { SQL_API_SQLNATIVESQL, "SQLNativeSql", SQLNativeSql, NULL },
81 /* 51 */ { SQL_API_SQLNUMPARAMS, "SQLNumParams", SQLNumParams, NULL },
82 /* 52 */ { SQL_API_SQLNUMRESULTCOLS, "SQLNumResultCols", SQLNumResultCols, NULL },
83 /* 53 */ { SQL_API_SQLPARAMDATA, "SQLParamData", SQLParamData, NULL },
84 /* 54 */ { SQL_API_SQLPARAMOPTIONS, "SQLParamOptions", SQLParamOptions, NULL },
85 /* 55 */ { SQL_API_SQLPREPARE, "SQLPrepare", SQLPrepare, NULL },
86 /* 56 */ { SQL_API_SQLPRIMARYKEYS, "SQLPrimaryKeys", SQLPrimaryKeys, NULL },
87 /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS, "SQLProcedureColumns", SQLProcedureColumns, NULL },
88 /* 58 */ { SQL_API_SQLPROCEDURES, "SQLProcedures", SQLProcedures, NULL },
89 /* 59 */ { SQL_API_SQLPUTDATA, "SQLPutData", SQLPutData, NULL },
90 /* 60 */ { SQL_API_SQLROWCOUNT, "SQLRowCount", SQLRowCount, NULL },
91 /* 61 */ { SQL_API_SQLSETCONNECTATTR, "SQLSetConnectAttr", SQLSetConnectAttr, NULL },
92 /* 62 */ { SQL_API_SQLSETCONNECTOPTION, "SQLSetConnectOption", SQLSetConnectOption, NULL },
93 /* 63 */ { SQL_API_SQLSETCURSORNAME, "SQLSetCursorName", SQLSetCursorName, NULL },
94 /* 64 */ { SQL_API_SQLSETDESCFIELD, "SQLSetDescField", SQLSetDescField, NULL },
95 /* 65 */ { SQL_API_SQLSETDESCREC, "SQLSetDescRec", SQLSetDescRec, NULL },
96 /* 66 */ { SQL_API_SQLSETENVATTR, "SQLSetEnvAttr", SQLSetEnvAttr, NULL },
97 /* 67 */ { SQL_API_SQLSETPARAM, "SQLSetParam", SQLSetParam, NULL },
98 /* 68 */ { SQL_API_SQLSETPOS, "SQLSetPos", SQLSetPos, NULL },
99 /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS, "SQLSetScrollOptions", SQLSetScrollOptions, NULL },
100 /* 70 */ { SQL_API_SQLSETSTMTATTR, "SQLSetStmtAttr", SQLSetStmtAttr, NULL },
101 /* 71 */ { SQL_API_SQLSETSTMTOPTION, "SQLSetStmtOption", SQLSetStmtOption, NULL },
102 /* 72 */ { SQL_API_SQLSPECIALCOLUMNS, "SQLSpecialColumns", SQLSpecialColumns, NULL },
103 /* 73 */ { SQL_API_SQLSTATISTICS, "SQLStatistics", SQLStatistics, NULL },
104 /* 74 */ { SQL_API_SQLTABLEPRIVILEGES, "SQLTablePrivileges", SQLTablePrivileges, NULL },
105 /* 75 */ { SQL_API_SQLTABLES, "SQLTables", SQLTables, NULL },
106 /* 76 */ { SQL_API_SQLTRANSACT, "SQLTransact", SQLTransact, NULL },
107 /* 77 */ { SQL_API_SQLGETDIAGREC, "SQLGetDiagRec", SQLGetDiagRec, NULL },
110 static PROXYHANDLE gProxyHandle = {
115 ERROR_LIBRARY_NOT_FOUND,
123 SQLRETURN SQLDummyFunc()
125 TRACE("SQLDummyFunc: \n");
129 /***********************************************************************
130 * MAIN_OdbcInit [Internal] Initializes the internal 'ODBC32.DLL'.
133 * hinstDLL [I] handle to the DLL's instance
135 * lpvReserved [I] reserved, must be NULL
143 MAIN_OdbcInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
146 TRACE("Initializing proxy ODBC: %x,%lx,%p\n", hinstDLL, fdwReason, lpvReserved);
148 if (fdwReason == DLL_PROCESS_ATTACH)
150 TRACE("Loading ODBC...\n");
151 if (ODBC_LoadDriverManager())
152 ODBC_LoadDMFunctions();
154 else if (fdwReason == DLL_PROCESS_DETACH)
156 TRACE("Unloading ODBC...\n");
157 if (gProxyHandle.bFunctionReady)
159 for ( i = 0; i < NUM_SQLFUNC; i ++ )
161 gProxyHandle.functions[i].func = SQLDummyFunc;
165 if (gProxyHandle.dmHandle)
167 dlclose(gProxyHandle.dmHandle);
168 gProxyHandle.dmHandle = NULL;
176 /***********************************************************************
177 * ODBC_LoadDriverManager [Internal] Load ODBC library.
186 BOOL ODBC_LoadDriverManager()
188 char *s = getenv("LIB_ODBC_DRIVER_MANAGER");
192 gProxyHandle.bFunctionReady = FALSE;
194 if (s != NULL && strlen(s) > 0)
195 strcpy(gProxyHandle.dmLibName, s);
197 strcpy(gProxyHandle.dmLibName, "libodbc.so");
199 gProxyHandle.dmHandle = dlopen(gProxyHandle.dmLibName, RTLD_LAZY);
201 if (gProxyHandle.dmHandle == NULL) /* fail to load unixODBC driver manager */
203 WARN("failed to open library %s\n", gProxyHandle.dmLibName);
204 gProxyHandle.dmLibName[0] = '\0';
205 gProxyHandle.nErrorType = ERROR_LIBRARY_NOT_FOUND;
210 gProxyHandle.nErrorType = ERROR_FREE;
216 /***********************************************************************
217 * ODBC_LoadDMFunctions [Internal] Populate function table.
226 BOOL ODBC_LoadDMFunctions()
230 if (gProxyHandle.dmHandle == NULL)
233 for ( i = 0; i < NUM_SQLFUNC; i ++ )
235 gProxyHandle.functions[i] = template_func[i];
236 gProxyHandle.functions[i].func = dlsym(gProxyHandle.dmHandle,
237 gProxyHandle.functions[i].name);
241 ERR("Failed to load function %s",gProxyHandle.functions[i].name);
242 gProxyHandle.functions[i].func = SQLDummyFunc;
246 gProxyHandle.bFunctionReady = TRUE;
252 /*************************************************************************
253 * SQLAllocConnect [ODBC32.001]
255 SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle)
259 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
261 *ConnectionHandle = SQL_NULL_HDBC;
265 return (gProxyHandle.functions[SQLAPI_INDEX_SQLALLOCCONNECT].func)
266 (EnvironmentHandle, ConnectionHandle);
270 /*************************************************************************
271 * SQLAllocEnv [ODBC32.002]
273 SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle)
277 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
279 *EnvironmentHandle = SQL_NULL_HENV;
283 return (gProxyHandle.functions[SQLAPI_INDEX_SQLALLOCENV].func) (EnvironmentHandle);
287 /*************************************************************************
288 * SQLAllocHandle [ODBC32.024]
290 SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
294 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
296 if (gProxyHandle.nErrorType == ERROR_LIBRARY_NOT_FOUND)
297 WARN("ProxyODBC: Can not load ODBC driver manager library.\n");
299 if (HandleType == SQL_HANDLE_ENV)
300 *OutputHandle = SQL_NULL_HENV;
301 else if (HandleType == SQL_HANDLE_DBC)
302 *OutputHandle = SQL_NULL_HDBC;
303 else if (HandleType == SQL_HANDLE_STMT)
304 *OutputHandle = SQL_NULL_HSTMT;
305 else if (HandleType == SQL_HANDLE_DESC)
306 *OutputHandle = SQL_NULL_HDESC;
311 return (gProxyHandle.functions[SQLAPI_INDEX_SQLALLOCHANDLE].func)
312 (HandleType, InputHandle, OutputHandle);
316 /*************************************************************************
317 * SQLAllocStmt [ODBC32.003]
319 SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle)
324 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
326 *StatementHandle = SQL_NULL_HSTMT;
330 return (gProxyHandle.functions[SQLAPI_INDEX_SQLALLOCSTMT].func)
331 (ConnectionHandle, StatementHandle);
335 /*************************************************************************
336 * SQLAllocHandleStd [ODBC32.077]
338 SQLRETURN WINAPI SQLAllocHandleStd( SQLSMALLINT HandleType,
339 SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
341 TRACE("ProxyODBC: SQLAllocHandelStd.\n");
343 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
345 if (gProxyHandle.nErrorType == ERROR_LIBRARY_NOT_FOUND)
346 WARN("ProxyODBC: Can not load ODBC driver manager library.\n");
348 if (HandleType == SQL_HANDLE_ENV)
349 *OutputHandle = SQL_NULL_HENV;
350 else if (HandleType == SQL_HANDLE_DBC)
351 *OutputHandle = SQL_NULL_HDBC;
352 else if (HandleType == SQL_HANDLE_STMT)
353 *OutputHandle = SQL_NULL_HSTMT;
354 else if (HandleType == SQL_HANDLE_DESC)
355 *OutputHandle = SQL_NULL_HDESC;
360 return (gProxyHandle.functions[SQLAPI_INDEX_SQLALLOCHANDLESTD].func)
361 (HandleType, InputHandle, OutputHandle);
365 /*************************************************************************
366 * SQLBindCol [ODBC32.004]
368 SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle,
369 SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
370 SQLPOINTER TargetValue, SQLINTEGER BufferLength,
371 SQLINTEGER *StrLen_or_Ind)
375 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
380 return (gProxyHandle.functions[SQLAPI_INDEX_SQLBINDCOL].func)
381 (StatementHandle, ColumnNumber, TargetType,
382 TargetValue, BufferLength, StrLen_or_Ind);
386 /*************************************************************************
387 * SQLBindParam [ODBC32.025]
389 SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle,
390 SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
391 SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
392 SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
393 SQLINTEGER *StrLen_or_Ind)
397 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
402 return (gProxyHandle.functions[SQLAPI_INDEX_SQLBINDPARAM].func)
403 (StatementHandle, ParameterNumber, ValueType,
404 ParameterScale, ParameterValue, StrLen_or_Ind);
408 /*************************************************************************
409 * SQLCancel [ODBC32.005]
411 SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle)
415 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
420 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCANCEL].func) (StatementHandle);
424 /*************************************************************************
425 * SQLCloseCursor [ODBC32.026]
427 SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle)
431 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
436 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCLOSECURSOR].func) (StatementHandle);
440 /*************************************************************************
441 * SQLColAttribute [ODBC32.027]
443 SQLRETURN WINAPI SQLColAttribute (SQLHSTMT StatementHandle,
444 SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
445 SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
446 SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute)
450 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
455 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLATTRIBUTE].func)
456 (StatementHandle, ColumnNumber, FieldIdentifier,
457 CharacterAttribute, BufferLength, StringLength, NumericAttribute);
461 /*************************************************************************
462 * SQLColumns [ODBC32.040]
464 SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle,
465 SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
466 SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
467 SQLCHAR *TableName, SQLSMALLINT NameLength3,
468 SQLCHAR *ColumnName, SQLSMALLINT NameLength4)
472 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
477 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLUMNS].func)
478 (StatementHandle, CatalogName, NameLength1,
479 SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4);
483 /*************************************************************************
484 * SQLConnect [ODBC32.007]
486 SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle,
487 SQLCHAR *ServerName, SQLSMALLINT NameLength1,
488 SQLCHAR *UserName, SQLSMALLINT NameLength2,
489 SQLCHAR *Authentication, SQLSMALLINT NameLength3)
493 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
498 strcpy(gProxyHandle.ServerName, ServerName);
499 strcpy(gProxyHandle.UserName, UserName);
501 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCONNECT].func)
502 (ConnectionHandle, ServerName, NameLength1,
503 UserName, NameLength2, Authentication, NameLength3);
507 /*************************************************************************
508 * SQLCopyDesc [ODBC32.028]
510 SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle)
514 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
519 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCOPYDESC].func)
520 (SourceDescHandle, TargetDescHandle);
524 /*************************************************************************
525 * SQLDataSources [ODBC32.057]
527 SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle,
528 SQLUSMALLINT Direction, SQLCHAR *ServerName,
529 SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
530 SQLCHAR *Description, SQLSMALLINT BufferLength2,
531 SQLSMALLINT *NameLength2)
535 TRACE("EnvironmentHandle = %p\n", (LPVOID)EnvironmentHandle);
537 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
539 ERR("Error: empty dm handle (gProxyHandle.dmHandle == NULL)\n");
543 ret = (gProxyHandle.functions[SQLAPI_INDEX_SQLDATASOURCES].func)
544 (EnvironmentHandle, Direction, ServerName,
545 BufferLength1, NameLength1, Description, BufferLength2, NameLength2);
549 TRACE("returns: %d \t", ret);
550 if (*NameLength1 > 0)
551 TRACE("DataSource = %s,", ServerName);
552 if (*NameLength2 > 0)
553 TRACE(" Description = %s\n", Description);
560 /*************************************************************************
561 * SQLDescribeCol [ODBC32.008]
563 SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle,
564 SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
565 SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
566 SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
567 SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
571 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
576 return (gProxyHandle.functions[SQLAPI_INDEX_SQLDESCRIBECOL].func)
577 (StatementHandle, ColumnNumber, ColumnName,
578 BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable);
582 /*************************************************************************
583 * SQLDisconnect [ODBC32.009]
585 SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle)
589 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
594 gProxyHandle.ServerName[0] = '\0';
595 gProxyHandle.UserName[0] = '\0';
597 return (gProxyHandle.functions[SQLAPI_INDEX_SQLDISCONNECT].func) (ConnectionHandle);
601 /*************************************************************************
602 * SQLEndTran [ODBC32.029]
604 SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType)
608 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
613 return (gProxyHandle.functions[SQLAPI_INDEX_SQLENDTRAN].func) (HandleType, Handle, CompletionType);
617 /*************************************************************************
618 * SQLError [ODBC32.010]
620 SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle,
621 SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
622 SQLCHAR *Sqlstate, SQLINTEGER *NativeError,
623 SQLCHAR *MessageText, SQLSMALLINT BufferLength,
624 SQLSMALLINT *TextLength)
628 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
633 return (gProxyHandle.functions[SQLAPI_INDEX_SQLERROR].func)
634 (EnvironmentHandle, ConnectionHandle, StatementHandle,
635 Sqlstate, NativeError, MessageText, BufferLength, TextLength);
639 /*************************************************************************
640 * SQLExecDirect [ODBC32.011]
642 SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
646 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
651 return (gProxyHandle.functions[SQLAPI_INDEX_SQLEXECDIRECT].func)
652 (StatementHandle, StatementText, TextLength);
656 /*************************************************************************
657 * SQLExecute [ODBC32.012]
659 SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle)
663 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
668 return (gProxyHandle.functions[SQLAPI_INDEX_SQLEXECUTE].func) (StatementHandle);
672 /*************************************************************************
673 * SQLFetch [ODBC32.013]
675 SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle)
679 if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
684 return (gProxyHandle.functions[SQLAPI_INDEX_SQLFETCH].func) (StatementHandle);
688 /*************************************************************************
689 * SQLFetchScroll [ODBC32.030]
691 SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset)
695 if (gProxyHandle.dmHandle == NULL)
700 return (gProxyHandle.functions[SQLAPI_INDEX_SQLFETCHSCROLL].func)
701 (StatementHandle, FetchOrientation, FetchOffset);
705 /*************************************************************************
706 * SQLFreeConnect [ODBC32.014]
708 SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle)
712 if (gProxyHandle.dmHandle == NULL)
717 return (gProxyHandle.functions[SQLAPI_INDEX_SQLFREECONNECT].func) (ConnectionHandle);
721 /*************************************************************************
722 * SQLFreeEnv [ODBC32.015]
724 SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle)
730 if (gProxyHandle.dmHandle == NULL)
735 ret = (gProxyHandle.functions[SQLAPI_INDEX_SQLFREEENV].func) (EnvironmentHandle);
737 if (gProxyHandle.dmHandle)
739 dlclose(gProxyHandle.dmHandle);
740 gProxyHandle.dmHandle = NULL;
748 /*************************************************************************
749 * SQLFreeHandle [ODBC32.031]
751 SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)
757 if (gProxyHandle.dmHandle == NULL)
762 ret = (gProxyHandle.functions[SQLAPI_INDEX_SQLFREEHANDLE].func)
763 (HandleType, Handle);
765 if (HandleType == SQL_HANDLE_ENV) /* it is time to close the loaded library */
767 if (gProxyHandle.dmHandle)
769 dlclose(gProxyHandle.dmHandle);
770 gProxyHandle.dmHandle = NULL;
778 /*************************************************************************
779 * SQLFreeStmt [ODBC32.016]
781 SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option)
786 if (gProxyHandle.dmHandle == NULL)
791 return (gProxyHandle.functions[SQLAPI_INDEX_SQLFREESTMT].func)
792 (StatementHandle, Option);
796 /*************************************************************************
797 * SQLGetConnectAttr [ODBC32.032]
799 SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle,
800 SQLINTEGER Attribute, SQLPOINTER Value,
801 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
805 if (gProxyHandle.dmHandle == NULL)
810 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCONNECTATTR].func)
811 (ConnectionHandle, Attribute, Value,
812 BufferLength, StringLength);
816 /*************************************************************************
817 * SQLGetConnectOption [ODBC32.042]
819 SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value)
823 if (gProxyHandle.dmHandle == NULL)
828 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCONNECTOPTION].func)
829 (ConnectionHandle, Option, Value);
833 /*************************************************************************
834 * SQLGetCursorName [ODBC32.017]
836 SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle,
837 SQLCHAR *CursorName, SQLSMALLINT BufferLength,
838 SQLSMALLINT *NameLength)
842 if (gProxyHandle.dmHandle == NULL)
847 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCURSORNAME].func)
848 (StatementHandle, CursorName, BufferLength, NameLength);
852 /*************************************************************************
853 * SQLGetData [ODBC32.043]
855 SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle,
856 SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
857 SQLPOINTER TargetValue, SQLINTEGER BufferLength,
858 SQLINTEGER *StrLen_or_Ind)
861 if (gProxyHandle.dmHandle == NULL)
866 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDATA].func)
867 (StatementHandle, ColumnNumber, TargetType,
868 TargetValue, BufferLength, StrLen_or_Ind);
872 /*************************************************************************
873 * SQLGetDescField [ODBC32.033]
875 SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle,
876 SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
877 SQLPOINTER Value, SQLINTEGER BufferLength,
878 SQLINTEGER *StringLength)
881 if (gProxyHandle.dmHandle == NULL)
886 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDESCFIELD].func)
887 (DescriptorHandle, RecNumber, FieldIdentifier,
888 Value, BufferLength, StringLength);
892 /*************************************************************************
893 * SQLGetDescRec [ODBC32.034]
895 SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle,
896 SQLSMALLINT RecNumber, SQLCHAR *Name,
897 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
898 SQLSMALLINT *Type, SQLSMALLINT *SubType,
899 SQLINTEGER *Length, SQLSMALLINT *Precision,
900 SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
903 if (gProxyHandle.dmHandle == NULL)
908 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDESCREC].func)
909 (DescriptorHandle, RecNumber, Name, BufferLength,
910 StringLength, Type, SubType, Length, Precision, Scale, Nullable);
914 /*************************************************************************
915 * SQLGetDiagField [ODBC32.035]
917 SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
918 SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
919 SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
920 SQLSMALLINT *StringLength)
923 if (gProxyHandle.dmHandle == NULL)
928 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDIAGFIELD].func)
929 (HandleType, Handle, RecNumber, DiagIdentifier,
930 DiagInfo, BufferLength, StringLength);
934 /*************************************************************************
935 * SQLGetDiagRec [ODBC32.036]
937 SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
938 SQLSMALLINT RecNumber, SQLCHAR *Sqlstate,
939 SQLINTEGER *NativeError, SQLCHAR *MessageText,
940 SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
943 if (gProxyHandle.dmHandle == NULL)
948 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDIAGREC].func)
949 (HandleType, Handle, RecNumber, Sqlstate, NativeError,
950 MessageText, BufferLength, TextLength);
954 /*************************************************************************
955 * SQLGetEnvAttr [ODBC32.037]
957 SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle,
958 SQLINTEGER Attribute, SQLPOINTER Value,
959 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
962 if (gProxyHandle.dmHandle == NULL)
967 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETENVATTR].func)
968 (EnvironmentHandle, Attribute, Value, BufferLength, StringLength);
972 /*************************************************************************
973 * SQLGetFunctions [ODBC32.044]
975 SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported)
978 if (gProxyHandle.dmHandle == NULL)
983 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETFUNCTIONS].func)
984 (ConnectionHandle, FunctionId, Supported);
988 /*************************************************************************
989 * SQLGetInfo [ODBC32.045]
991 SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle,
992 SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
993 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
996 if (gProxyHandle.dmHandle == NULL)
1001 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETINFO].func)
1002 (ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength);
1006 /*************************************************************************
1007 * SQLGetStmtAttr [ODBC32.038]
1009 SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle,
1010 SQLINTEGER Attribute, SQLPOINTER Value,
1011 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
1014 if (gProxyHandle.dmHandle == NULL)
1019 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETSTMTATTR].func)
1020 (StatementHandle, Attribute, Value, BufferLength, StringLength);
1024 /*************************************************************************
1025 * SQLGetStmtOption [ODBC32.046]
1027 SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value)
1030 if (gProxyHandle.dmHandle == NULL)
1035 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETSTMTOPTION].func)
1036 (StatementHandle, Option, Value);
1040 /*************************************************************************
1041 * SQLGetTypeInfo [ODBC32.047]
1043 SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
1046 if (gProxyHandle.dmHandle == NULL)
1051 return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETTYPEINFO].func)
1052 (StatementHandle, DataType);
1056 /*************************************************************************
1057 * SQLNumResultCols [ODBC32.018]
1059 SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount)
1062 if (gProxyHandle.dmHandle == NULL)
1067 return (gProxyHandle.functions[SQLAPI_INDEX_SQLNUMRESULTCOLS].func)
1068 (StatementHandle, ColumnCount);
1072 /*************************************************************************
1073 * SQLParamData [ODBC32.048]
1075 SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value)
1078 if (gProxyHandle.dmHandle == NULL)
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)
1094 if (gProxyHandle.dmHandle == NULL)
1099 return (gProxyHandle.functions[SQLAPI_INDEX_SQLPREPARE].func)
1100 (StatementHandle, StatementText, TextLength);
1104 /*************************************************************************
1105 * SQLPutData [ODBC32.049]
1107 SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLINTEGER StrLen_or_Ind)
1110 if (gProxyHandle.dmHandle == NULL)
1115 return (gProxyHandle.functions[SQLAPI_INDEX_SQLPUTDATA].func)
1116 (StatementHandle, Data, StrLen_or_Ind);
1120 /*************************************************************************
1121 * SQLRowCount [ODBC32.020]
1123 SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLINTEGER *RowCount)
1126 if (gProxyHandle.dmHandle == NULL)
1131 return (gProxyHandle.functions[SQLAPI_INDEX_SQLROWCOUNT].func)
1132 (StatementHandle, RowCount);
1136 /*************************************************************************
1137 * SQLSetConnectAttr [ODBC32.039]
1139 SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute,
1140 SQLPOINTER Value, SQLINTEGER StringLength)
1143 if (gProxyHandle.dmHandle == NULL)
1148 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCONNECTATTR].func)
1149 (ConnectionHandle, Attribute, Value, StringLength);
1153 /*************************************************************************
1154 * SQLSetConnectOption [ODBC32.050]
1156 SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLUINTEGER Value)
1159 if (gProxyHandle.dmHandle == NULL)
1164 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCONNECTOPTION].func)
1165 (ConnectionHandle, Option, Value);
1169 /*************************************************************************
1170 * SQLSetCursorName [ODBC32.021]
1172 SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength)
1175 if (gProxyHandle.dmHandle == NULL)
1180 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCURSORNAME].func)
1181 (StatementHandle, CursorName, NameLength);
1185 /*************************************************************************
1186 * SQLSetDescField [ODBC32.073]
1188 SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle,
1189 SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
1190 SQLPOINTER Value, SQLINTEGER BufferLength)
1193 if (gProxyHandle.dmHandle == NULL)
1198 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETDESCFIELD].func)
1199 (DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
1203 /*************************************************************************
1204 * SQLSetDescRec [ODBC32.074]
1206 SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle,
1207 SQLSMALLINT RecNumber, SQLSMALLINT Type,
1208 SQLSMALLINT SubType, SQLINTEGER Length,
1209 SQLSMALLINT Precision, SQLSMALLINT Scale,
1210 SQLPOINTER Data, SQLINTEGER *StringLength,
1211 SQLINTEGER *Indicator)
1214 if (gProxyHandle.dmHandle == NULL)
1219 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETDESCREC].func)
1220 (DescriptorHandle, RecNumber, Type, SubType, Length,
1221 Precision, Scale, Data, StringLength, Indicator);
1225 /*************************************************************************
1226 * SQLSetEnvAttr [ODBC32.075]
1228 SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle,
1229 SQLINTEGER Attribute, SQLPOINTER Value,
1230 SQLINTEGER StringLength)
1233 if (gProxyHandle.dmHandle == NULL)
1238 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETENVATTR].func)
1239 (EnvironmentHandle, Attribute, Value, StringLength);
1243 /*************************************************************************
1244 * SQLSetParam [ODBC32.022]
1246 SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle,
1247 SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
1248 SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
1249 SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
1250 SQLINTEGER *StrLen_or_Ind)
1253 if (gProxyHandle.dmHandle == NULL)
1258 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETPARAM].func)
1259 (StatementHandle, ParameterNumber, ValueType, ParameterType, LengthPrecision,
1260 ParameterScale, ParameterValue, StrLen_or_Ind);
1264 /*************************************************************************
1265 * SQLSetStmtAttr [ODBC32.076]
1267 SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle,
1268 SQLINTEGER Attribute, SQLPOINTER Value,
1269 SQLINTEGER StringLength)
1272 if (gProxyHandle.dmHandle == NULL)
1277 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETSTMTATTR].func)
1278 (StatementHandle, Attribute, Value, StringLength);
1282 /*************************************************************************
1283 * SQLSetStmtOption [ODBC32.051]
1285 SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLUINTEGER Value)
1288 if (gProxyHandle.dmHandle == NULL)
1293 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETSTMTOPTION].func)
1294 (StatementHandle, Option, Value);
1298 /*************************************************************************
1299 * SQLSpecialColumns [ODBC32.052]
1301 SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle,
1302 SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
1303 SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
1304 SQLSMALLINT NameLength2, SQLCHAR *TableName,
1305 SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
1306 SQLUSMALLINT Nullable)
1308 if (gProxyHandle.dmHandle == NULL)
1313 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSPECIALCOLUMNS].func)
1314 (StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName,
1315 NameLength2, TableName, NameLength3, Scope, Nullable);
1319 /*************************************************************************
1320 * SQLStatistics [ODBC32.053]
1322 SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle,
1323 SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
1324 SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
1325 SQLCHAR *TableName, SQLSMALLINT NameLength3,
1326 SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
1329 if (gProxyHandle.dmHandle == NULL)
1334 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSTATISTICS].func)
1335 (StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2,
1336 TableName, NameLength3, Unique, Reserved);
1340 /*************************************************************************
1341 * SQLTables [ODBC32.054]
1343 SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle,
1344 SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
1345 SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
1346 SQLCHAR *TableName, SQLSMALLINT NameLength3,
1347 SQLCHAR *TableType, SQLSMALLINT NameLength4)
1350 if (gProxyHandle.dmHandle == NULL)
1355 return (gProxyHandle.functions[SQLAPI_INDEX_SQLTABLES].func)
1356 (StatementHandle, CatalogName, NameLength1,
1357 SchemaName, NameLength2, TableName, NameLength3, TableType, NameLength4);
1361 /*************************************************************************
1362 * SQLTransact [ODBC32.023]
1364 SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle,
1365 SQLUSMALLINT CompletionType)
1368 if (gProxyHandle.dmHandle == NULL)
1373 return (gProxyHandle.functions[SQLAPI_INDEX_SQLTRANSACT].func)
1374 (EnvironmentHandle, ConnectionHandle, CompletionType);
1378 /*************************************************************************
1379 * SQLBrowseConnect [ODBC32.055]
1381 SQLRETURN WINAPI SQLBrowseConnect(
1383 SQLCHAR *szConnStrIn,
1384 SQLSMALLINT cbConnStrIn,
1385 SQLCHAR *szConnStrOut,
1386 SQLSMALLINT cbConnStrOutMax,
1387 SQLSMALLINT *pcbConnStrOut)
1390 if (gProxyHandle.dmHandle == NULL)
1395 return (gProxyHandle.functions[SQLAPI_INDEX_SQLBROWSECONNECT].func)
1396 (hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut);
1400 /*************************************************************************
1401 * SQLBulkOperations [ODBC32.078]
1403 SQLRETURN WINAPI SQLBulkOperations(
1404 SQLHSTMT StatementHandle,
1405 SQLSMALLINT Operation)
1408 if (gProxyHandle.dmHandle == NULL)
1413 return (gProxyHandle.functions[SQLAPI_INDEX_SQLBULKOPERATIONS].func)
1414 (StatementHandle, Operation);
1418 /*************************************************************************
1419 * SQLColAttributes [ODBC32.006]
1421 SQLRETURN WINAPI SQLColAttributes(
1424 SQLUSMALLINT fDescType,
1426 SQLSMALLINT cbDescMax,
1427 SQLSMALLINT *pcbDesc,
1431 if (gProxyHandle.dmHandle == NULL)
1436 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLATTRIBUTES].func)
1437 (hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
1441 /*************************************************************************
1442 * SQLColumnPrivileges [ODBC32.056]
1444 SQLRETURN WINAPI SQLColumnPrivileges(
1446 SQLCHAR *szCatalogName,
1447 SQLSMALLINT cbCatalogName,
1448 SQLCHAR *szSchemaName,
1449 SQLSMALLINT cbSchemaName,
1450 SQLCHAR *szTableName,
1451 SQLSMALLINT cbTableName,
1452 SQLCHAR *szColumnName,
1453 SQLSMALLINT cbColumnName)
1456 if (gProxyHandle.dmHandle == NULL)
1461 return (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLUMNPRIVILEGES].func)
1462 (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
1463 szTableName, cbTableName, szColumnName, cbColumnName);
1467 /*************************************************************************
1468 * SQLDescribeParam [ODBC32.058]
1470 SQLRETURN WINAPI SQLDescribeParam(
1473 SQLSMALLINT *pfSqlType,
1474 SQLUINTEGER *pcbParamDef,
1475 SQLSMALLINT *pibScale,
1476 SQLSMALLINT *pfNullable)
1479 if (gProxyHandle.dmHandle == NULL)
1484 return (gProxyHandle.functions[SQLAPI_INDEX_SQLDESCRIBEPARAM].func)
1485 (hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable);
1489 /*************************************************************************
1490 * SQLExtendedFetch [ODBC32.059]
1492 SQLRETURN WINAPI SQLExtendedFetch(
1494 SQLUSMALLINT fFetchType,
1497 SQLUSMALLINT *rgfRowStatus)
1500 if (gProxyHandle.dmHandle == NULL)
1505 return (gProxyHandle.functions[SQLAPI_INDEX_SQLEXTENDEDFETCH].func)
1506 (hstmt, fFetchType, irow, pcrow, rgfRowStatus);
1510 /*************************************************************************
1511 * SQLForeignKeys [ODBC32.060]
1513 SQLRETURN WINAPI SQLForeignKeys(
1515 SQLCHAR *szPkCatalogName,
1516 SQLSMALLINT cbPkCatalogName,
1517 SQLCHAR *szPkSchemaName,
1518 SQLSMALLINT cbPkSchemaName,
1519 SQLCHAR *szPkTableName,
1520 SQLSMALLINT cbPkTableName,
1521 SQLCHAR *szFkCatalogName,
1522 SQLSMALLINT cbFkCatalogName,
1523 SQLCHAR *szFkSchemaName,
1524 SQLSMALLINT cbFkSchemaName,
1525 SQLCHAR *szFkTableName,
1526 SQLSMALLINT cbFkTableName)
1529 if (gProxyHandle.dmHandle == NULL)
1534 return (gProxyHandle.functions[SQLAPI_INDEX_SQLFOREIGNKEYS].func)
1535 (hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName,
1536 szPkTableName, cbPkTableName, szFkCatalogName, cbFkCatalogName, szFkSchemaName,
1537 cbFkSchemaName, szFkTableName, cbFkTableName);
1541 /*************************************************************************
1542 * SQLMoreResults [ODBC32.061]
1544 SQLRETURN WINAPI SQLMoreResults(SQLHSTMT hstmt)
1547 if (gProxyHandle.dmHandle == NULL)
1552 return (gProxyHandle.functions[SQLAPI_INDEX_SQLMORERESULTS].func) (hstmt);
1556 /*************************************************************************
1557 * SQLNativeSql [ODBC32.062]
1559 SQLRETURN WINAPI SQLNativeSql(
1561 SQLCHAR *szSqlStrIn,
1562 SQLINTEGER cbSqlStrIn,
1564 SQLINTEGER cbSqlStrMax,
1565 SQLINTEGER *pcbSqlStr)
1568 if (gProxyHandle.dmHandle == NULL)
1573 return (gProxyHandle.functions[SQLAPI_INDEX_SQLNATIVESQL].func)
1574 (hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
1578 /*************************************************************************
1579 * SQLNumParams [ODBC32.063]
1581 SQLRETURN WINAPI SQLNumParams(
1586 if (gProxyHandle.dmHandle == NULL)
1591 return (gProxyHandle.functions[SQLAPI_INDEX_SQLNUMPARAMS].func) (hstmt, pcpar);
1595 /*************************************************************************
1596 * SQLParamOptions [ODBC32.064]
1598 SQLRETURN WINAPI SQLParamOptions(
1604 if (gProxyHandle.dmHandle == NULL)
1609 return (gProxyHandle.functions[SQLAPI_INDEX_SQLPARAMOPTIONS].func) (hstmt, crow, pirow);
1613 /*************************************************************************
1614 * SQLPrimaryKeys [ODBC32.065]
1616 SQLRETURN WINAPI SQLPrimaryKeys(
1618 SQLCHAR *szCatalogName,
1619 SQLSMALLINT cbCatalogName,
1620 SQLCHAR *szSchemaName,
1621 SQLSMALLINT cbSchemaName,
1622 SQLCHAR *szTableName,
1623 SQLSMALLINT cbTableName)
1626 if (gProxyHandle.dmHandle == NULL)
1631 return (gProxyHandle.functions[SQLAPI_INDEX_SQLPRIMARYKEYS].func)
1632 (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
1633 szTableName, cbTableName);
1637 /*************************************************************************
1638 * SQLProcedureColumns [ODBC32.066]
1640 SQLRETURN WINAPI SQLProcedureColumns(
1642 SQLCHAR *szCatalogName,
1643 SQLSMALLINT cbCatalogName,
1644 SQLCHAR *szSchemaName,
1645 SQLSMALLINT cbSchemaName,
1646 SQLCHAR *szProcName,
1647 SQLSMALLINT cbProcName,
1648 SQLCHAR *szColumnName,
1649 SQLSMALLINT cbColumnName)
1652 if (gProxyHandle.dmHandle == NULL)
1657 return (gProxyHandle.functions[SQLAPI_INDEX_SQLPROCEDURECOLUMNS].func)
1658 (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
1659 szProcName, cbProcName, szColumnName, cbColumnName);
1663 /*************************************************************************
1664 * SQLProcedures [ODBC32.067]
1666 SQLRETURN WINAPI SQLProcedures(
1668 SQLCHAR *szCatalogName,
1669 SQLSMALLINT cbCatalogName,
1670 SQLCHAR *szSchemaName,
1671 SQLSMALLINT cbSchemaName,
1672 SQLCHAR *szProcName,
1673 SQLSMALLINT cbProcName)
1676 if (gProxyHandle.dmHandle == NULL)
1681 return (gProxyHandle.functions[SQLAPI_INDEX_SQLPROCEDURES].func)
1682 (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
1683 szProcName, cbProcName);
1687 /*************************************************************************
1688 * SQLSetPos [ODBC32.068]
1690 SQLRETURN WINAPI SQLSetPos(
1693 SQLUSMALLINT fOption,
1697 if (gProxyHandle.dmHandle == NULL)
1702 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETPOS].func)
1703 (hstmt, irow, fOption, fLock);
1707 /*************************************************************************
1708 * SQLTablePrivileges [ODBC32.070]
1710 SQLRETURN WINAPI SQLTablePrivileges(
1712 SQLCHAR *szCatalogName,
1713 SQLSMALLINT cbCatalogName,
1714 SQLCHAR *szSchemaName,
1715 SQLSMALLINT cbSchemaName,
1716 SQLCHAR *szTableName,
1717 SQLSMALLINT cbTableName)
1720 if (gProxyHandle.dmHandle == NULL)
1725 return (gProxyHandle.functions[SQLAPI_INDEX_SQLTABLEPRIVILEGES].func)
1726 (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
1727 szTableName, cbTableName);
1731 /*************************************************************************
1732 * SQLDrivers [ODBC32.071]
1734 SQLRETURN WINAPI SQLDrivers(
1736 SQLUSMALLINT fDirection,
1737 SQLCHAR *szDriverDesc,
1738 SQLSMALLINT cbDriverDescMax,
1739 SQLSMALLINT *pcbDriverDesc,
1740 SQLCHAR *szDriverAttributes,
1741 SQLSMALLINT cbDriverAttrMax,
1742 SQLSMALLINT *pcbDriverAttr)
1745 if (gProxyHandle.dmHandle == NULL)
1750 return (gProxyHandle.functions[SQLAPI_INDEX_SQLDRIVERS].func)
1751 (henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc,
1752 szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
1756 /*************************************************************************
1757 * SQLBindParameter [ODBC32.072]
1759 SQLRETURN WINAPI SQLBindParameter(
1762 SQLSMALLINT fParamType,
1764 SQLSMALLINT fSqlType,
1765 SQLUINTEGER cbColDef,
1766 SQLSMALLINT ibScale,
1767 SQLPOINTER rgbValue,
1768 SQLINTEGER cbValueMax,
1769 SQLINTEGER *pcbValue)
1772 if (gProxyHandle.dmHandle == NULL)
1777 return (gProxyHandle.functions[SQLAPI_INDEX_SQLBINDPARAMETER].func)
1778 (hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale,
1779 rgbValue, cbValueMax, pcbValue);
1783 /*************************************************************************
1784 * SQLDriverConnect [ODBC32.041]
1786 SQLRETURN WINAPI SQLDriverConnect(
1789 SQLCHAR *conn_str_in,
1790 SQLSMALLINT len_conn_str_in,
1791 SQLCHAR *conn_str_out,
1792 SQLSMALLINT conn_str_out_max,
1793 SQLSMALLINT *ptr_conn_str_out,
1794 SQLUSMALLINT driver_completion )
1797 if (gProxyHandle.dmHandle == NULL)
1802 return (gProxyHandle.functions[SQLAPI_INDEX_SQLDRIVERCONNECT].func)
1803 (hdbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out,
1804 conn_str_out_max, ptr_conn_str_out, driver_completion);
1808 /*************************************************************************
1809 * SQLSetScrollOptions [ODBC32.069]
1811 SQLRETURN WINAPI SQLSetScrollOptions(
1812 SQLHSTMT statement_handle,
1813 SQLUSMALLINT f_concurrency,
1814 SQLINTEGER crow_keyset,
1815 SQLUSMALLINT crow_rowset )
1818 if (gProxyHandle.dmHandle == NULL)
1823 return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETSCROLLOPTIONS].func)
1824 (statement_handle, f_concurrency, crow_keyset, crow_rowset);