1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef __ODBCINST_H 7 #define __ODBCINST_H 8 9 #include <sql.h> 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 #ifndef ODBCVER 16 #define ODBCVER 0x0351 17 #endif 18 19 #define ODBC_ADD_DSN 1 20 #define ODBC_CONFIG_DSN 2 21 #define ODBC_REMOVE_DSN 3 22 23 #if (ODBCVER >= 0x0250) 24 #define ODBC_ADD_SYS_DSN 4 25 #define ODBC_CONFIG_SYS_DSN 5 26 #define ODBC_REMOVE_SYS_DSN 6 27 #if (ODBCVER >= 0x0300) 28 #define ODBC_REMOVE_DEFAULT_DSN 7 29 #endif 30 31 #define ODBC_INSTALL_INQUIRY 1 32 #define ODBC_INSTALL_COMPLETE 2 33 34 #define ODBC_INSTALL_DRIVER 1 35 #define ODBC_REMOVE_DRIVER 2 36 #define ODBC_CONFIG_DRIVER 3 37 #define ODBC_CONFIG_DRIVER_MAX 100 38 #endif 39 40 #if (ODBCVER >= 0x0300) 41 #define ODBC_BOTH_DSN 0 42 #define ODBC_USER_DSN 1 43 #define ODBC_SYSTEM_DSN 2 44 #endif 45 46 #if (ODBCVER >= 0x0300) 47 #define ODBC_ERROR_GENERAL_ERR 1 48 #define ODBC_ERROR_INVALID_BUFF_LEN 2 49 #define ODBC_ERROR_INVALID_HWND 3 50 #define ODBC_ERROR_INVALID_STR 4 51 #define ODBC_ERROR_INVALID_REQUEST_TYPE 5 52 #define ODBC_ERROR_COMPONENT_NOT_FOUND 6 53 #define ODBC_ERROR_INVALID_NAME 7 54 #define ODBC_ERROR_INVALID_KEYWORD_VALUE 8 55 #define ODBC_ERROR_INVALID_DSN 9 56 #define ODBC_ERROR_INVALID_INF 10 57 #define ODBC_ERROR_REQUEST_FAILED 11 58 #define ODBC_ERROR_INVALID_PATH 12 59 #define ODBC_ERROR_LOAD_LIB_FAILED 13 60 #define ODBC_ERROR_INVALID_PARAM_SEQUENCE 14 61 #define ODBC_ERROR_INVALID_LOG_FILE 15 62 #define ODBC_ERROR_USER_CANCELED 16 63 #define ODBC_ERROR_USAGE_UPDATE_FAILED 17 64 #define ODBC_ERROR_CREATE_DSN_FAILED 18 65 #define ODBC_ERROR_WRITING_SYSINFO_FAILED 19 66 #define ODBC_ERROR_REMOVE_DSN_FAILED 20 67 #define ODBC_ERROR_OUT_OF_MEM 21 68 #define ODBC_ERROR_OUTPUT_STRING_TRUNCATED 22 69 #endif 70 71 #ifndef EXPORT 72 #define EXPORT 73 #endif 74 75 #ifndef RC_INVOKED 76 77 #ifndef WINAPI 78 #define WINAPI __stdcall 79 #endif 80 81 #define INSTAPI WINAPI 82 83 WINBOOL WINAPI SQLInstallODBC(HWND hwndParent,LPCSTR lpszInfFile,LPCSTR lpszSrcPath,LPCSTR lpszDrivers); 84 WINBOOL WINAPI SQLManageDataSources(HWND hwndParent); 85 WINBOOL WINAPI SQLCreateDataSource(HWND hwndParent,LPCSTR lpszDSN); 86 WINBOOL WINAPI SQLGetTranslator(HWND hwnd,LPSTR lpszName,WORD cbNameMax,WORD *pcbNameOut,LPSTR lpszPath,WORD cbPathMax,WORD *pcbPathOut,DWORD *pvOption); 87 WINBOOL WINAPI SQLInstallDriver(LPCSTR lpszInfFile,LPCSTR lpszDriver,LPSTR lpszPath,WORD cbPathMax,WORD *pcbPathOut); 88 WINBOOL WINAPI SQLInstallDriverManager (LPSTR lpszPath,WORD cbPathMax,WORD *pcbPathOut); 89 WINBOOL WINAPI SQLGetInstalledDrivers (LPSTR lpszBuf,WORD cbBufMax,WORD *pcbBufOut); 90 WINBOOL WINAPI SQLGetAvailableDrivers(LPCSTR lpszInfFile,LPSTR lpszBuf,WORD cbBufMax,WORD *pcbBufOut); 91 WINBOOL WINAPI SQLConfigDataSource(HWND hwndParent,WORD fRequest,LPCSTR lpszDriver,LPCSTR lpszAttributes); 92 WINBOOL WINAPI SQLRemoveDefaultDataSource(void); 93 WINBOOL WINAPI SQLWriteDSNToIni(LPCSTR lpszDSN,LPCSTR lpszDriver); 94 WINBOOL WINAPI SQLRemoveDSNFromIni(LPCSTR lpszDSN); 95 WINBOOL WINAPI SQLValidDSN(LPCSTR lpszDSN); 96 WINBOOL WINAPI SQLWritePrivateProfileString(LPCSTR lpszSection,LPCSTR lpszEntry,LPCSTR lpszString,LPCSTR lpszFilename); 97 int WINAPI SQLGetPrivateProfileString(LPCSTR lpszSection,LPCSTR lpszEntry,LPCSTR lpszDefault,LPSTR lpszRetBuffer,int cbRetBuffer,LPCSTR lpszFilename); 98 #if (ODBCVER >= 0x0250) 99 WINBOOL WINAPI SQLRemoveDriverManager(LPDWORD lpdwUsageCount); 100 WINBOOL WINAPI SQLInstallTranslator(LPCSTR lpszInfFile,LPCSTR lpszTranslator,LPCSTR lpszPathIn,LPSTR lpszPathOut,WORD cbPathOutMax,WORD *pcbPathOut,WORD fRequest,LPDWORD lpdwUsageCount); 101 WINBOOL WINAPI SQLRemoveTranslator(LPCSTR lpszTranslator,LPDWORD lpdwUsageCount); 102 WINBOOL WINAPI SQLRemoveDriver(LPCSTR lpszDriver,WINBOOL fRemoveDSN,LPDWORD lpdwUsageCount); 103 WINBOOL WINAPI SQLConfigDriver(HWND hwndParent,WORD fRequest,LPCSTR lpszDriver,LPCSTR lpszArgs,LPSTR lpszMsg,WORD cbMsgMax,WORD *pcbMsgOut); 104 #endif 105 106 #if (ODBCVER >= 0x0300) 107 SQLRETURN WINAPI SQLInstallerError(WORD iError,DWORD *pfErrorCode,LPSTR lpszErrorMsg,WORD cbErrorMsgMax,WORD *pcbErrorMsg); 108 SQLRETURN WINAPI SQLPostInstallerError(DWORD dwErrorCode,LPCSTR lpszErrMsg); 109 WINBOOL WINAPI SQLWriteFileDSN(LPCSTR lpszFileName,LPCSTR lpszAppName,LPCSTR lpszKeyName,LPCSTR lpszString); 110 WINBOOL WINAPI SQLReadFileDSN(LPCSTR lpszFileName,LPCSTR lpszAppName,LPCSTR lpszKeyName,LPSTR lpszString,WORD cbString,WORD *pcbString); 111 WINBOOL WINAPI SQLInstallDriverEx(LPCSTR lpszDriver,LPCSTR lpszPathIn,LPSTR lpszPathOut,WORD cbPathOutMax,WORD *pcbPathOut,WORD fRequest,LPDWORD lpdwUsageCount); 112 WINBOOL WINAPI SQLInstallTranslatorEx(LPCSTR lpszTranslator,LPCSTR lpszPathIn,LPSTR lpszPathOut,WORD cbPathOutMax,WORD *pcbPathOut,WORD fRequest,LPDWORD lpdwUsageCount); 113 WINBOOL WINAPI SQLGetConfigMode(UWORD *pwConfigMode); 114 WINBOOL WINAPI SQLSetConfigMode(UWORD wConfigMode); 115 #endif 116 117 WINBOOL WINAPI ConfigDSN(HWND hwndParent,WORD fRequest,LPCSTR lpszDriver,LPCSTR lpszAttributes); 118 WINBOOL WINAPI ConfigTranslator(HWND hwndParent,DWORD *pvOption); 119 #if (ODBCVER >= 0x0250) 120 WINBOOL WINAPI ConfigDriver(HWND hwndParent,WORD fRequest,LPCSTR lpszDriver,LPCSTR lpszArgs,LPSTR lpszMsg,WORD cbMsgMax,WORD *pcbMsgOut); 121 #endif 122 WINBOOL WINAPI SQLInstallODBCW(HWND hwndParent,LPCWSTR lpszInfFile,LPCWSTR lpszSrcPath,LPCWSTR lpszDrivers); 123 WINBOOL WINAPI SQLCreateDataSourceW(HWND hwndParent,LPCWSTR lpszDSN); 124 WINBOOL WINAPI SQLGetTranslatorW(HWND hwnd,LPWSTR lpszName,WORD cbNameMax,WORD *pcbNameOut,LPWSTR lpszPath,WORD cbPathMax,WORD *pcbPathOut,DWORD *pvOption); 125 WINBOOL WINAPI SQLInstallDriverW (LPCWSTR lpszInfFile,LPCWSTR lpszDriver,LPWSTR lpszPath,WORD cbPathMax,WORD *pcbPathOut); 126 WINBOOL WINAPI SQLInstallDriverManagerW (LPWSTR lpszPath,WORD cbPathMax,WORD *pcbPathOut); 127 WINBOOL WINAPI SQLGetInstalledDriversW (LPWSTR lpszBuf,WORD cbBufMax,WORD *pcbBufOut); 128 WINBOOL WINAPI SQLGetAvailableDriversW (LPCWSTR lpszInfFile,LPWSTR lpszBuf,WORD cbBufMax,WORD *pcbBufOut); 129 WINBOOL WINAPI SQLConfigDataSourceW(HWND hwndParent,WORD fRequest,LPCWSTR lpszDriver,LPCWSTR lpszAttributes); 130 WINBOOL WINAPI SQLWriteDSNToIniW (LPCWSTR lpszDSN,LPCWSTR lpszDriver); 131 WINBOOL WINAPI SQLRemoveDSNFromIniW (LPCWSTR lpszDSN); 132 WINBOOL WINAPI SQLValidDSNW (LPCWSTR lpszDSN); 133 WINBOOL WINAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection,LPCWSTR lpszEntry,LPCWSTR lpszString,LPCWSTR lpszFilename); 134 int WINAPI SQLGetPrivateProfileStringW(LPCWSTR lpszSection,LPCWSTR lpszEntry,LPCWSTR lpszDefault,LPWSTR lpszRetBuffer,int cbRetBuffer,LPCWSTR lpszFilename); 135 #if (ODBCVER >= 0x0250) 136 WINBOOL WINAPI SQLInstallTranslatorW(LPCWSTR lpszInfFile,LPCWSTR lpszTranslator,LPCWSTR lpszPathIn,LPWSTR lpszPathOut,WORD cbPathOutMax,WORD *pcbPathOut,WORD fRequest,LPDWORD lpdwUsageCount); 137 WINBOOL WINAPI SQLRemoveTranslatorW(LPCWSTR lpszTranslator,LPDWORD lpdwUsageCount); 138 WINBOOL WINAPI SQLRemoveDriverW(LPCWSTR lpszDriver,WINBOOL fRemoveDSN,LPDWORD lpdwUsageCount); 139 WINBOOL WINAPI SQLConfigDriverW(HWND hwndParent,WORD fRequest,LPCWSTR lpszDriver,LPCWSTR lpszArgs,LPWSTR lpszMsg,WORD cbMsgMax,WORD *pcbMsgOut); 140 #endif 141 #if (ODBCVER >= 0x0300) 142 SQLRETURN WINAPI SQLInstallerErrorW(WORD iError,DWORD *pfErrorCode,LPWSTR lpszErrorMsg,WORD cbErrorMsgMax,WORD *pcbErrorMsg); 143 SQLRETURN WINAPI SQLPostInstallerErrorW(DWORD dwErrorCode,LPCWSTR lpszErrorMsg); 144 WINBOOL WINAPI SQLWriteFileDSNW(LPCWSTR lpszFileName,LPCWSTR lpszAppName,LPCWSTR lpszKeyName,LPCWSTR lpszString); 145 WINBOOL WINAPI SQLReadFileDSNW(LPCWSTR lpszFileName,LPCWSTR lpszAppName,LPCWSTR lpszKeyName,LPWSTR lpszString,WORD cbString,WORD *pcbString); 146 WINBOOL WINAPI SQLInstallDriverExW(LPCWSTR lpszDriver,LPCWSTR lpszPathIn,LPWSTR lpszPathOut,WORD cbPathOutMax,WORD *pcbPathOut,WORD fRequest,LPDWORD lpdwUsageCount); 147 WINBOOL WINAPI SQLInstallTranslatorExW(LPCWSTR lpszTranslator,LPCWSTR lpszPathIn,LPWSTR lpszPathOut,WORD cbPathOutMax,WORD *pcbPathOut,WORD fRequest,LPDWORD lpdwUsageCount); 148 #endif 149 150 WINBOOL WINAPI ConfigDSNW(HWND hwndParent,WORD fRequest,LPCWSTR lpszDriver,LPCWSTR lpszAttributes); 151 152 #if (ODBCVER >= 0x0250) 153 WINBOOL WINAPI ConfigDriverW(HWND hwndParent,WORD fRequest,LPCWSTR lpszDriver,LPCWSTR lpszArgs,LPWSTR lpszMsg,WORD cbMsgMax,WORD *pcbMsgOut); 154 #endif 155 156 #ifndef SQL_NOUNICODEMAP 157 158 #if defined(UNICODE) 159 #define SQLInstallODBC SQLInstallODBCW 160 #define SQLCreateDataSource SQLCreateDataSourceW 161 #define SQLGetTranslator SQLGetTranslatorW 162 #define SQLInstallDriver SQLInstallDriverW 163 #define SQLInstallDriverManager SQLInstallDriverManagerW 164 #define SQLGetInstalledDrivers SQLGetInstalledDriversW 165 #define SQLGetAvailableDrivers SQLGetAvailableDriversW 166 #define SQLConfigDataSource SQLConfigDataSourceW 167 #define SQLWriteDSNToIni SQLWriteDSNToIniW 168 #define SQLRemoveDSNFromIni SQLRemoveDSNFromIniW 169 #define SQLValidDSN SQLValidDSNW 170 #define SQLWritePrivateProfileString SQLWritePrivateProfileStringW 171 #define SQLGetPrivateProfileString SQLGetPrivateProfileStringW 172 #define SQLInstallTranslator SQLInstallTranslatorW 173 #define SQLRemoveTranslator SQLRemoveTranslatorW 174 #define SQLRemoveDriver SQLRemoveDriverW 175 #define SQLConfigDriver SQLConfigDriverW 176 #define SQLInstallerError SQLInstallerErrorW 177 #define SQLPostInstallerError SQLPostInstallerErrorW 178 #define SQLReadFileDSN SQLReadFileDSNW 179 #define SQLWriteFileDSN SQLWriteFileDSNW 180 #define SQLInstallDriverEx SQLInstallDriverExW 181 #define SQLInstallTranslatorEx SQLInstallTranslatorExW 182 #endif 183 184 #endif 185 #endif 186 187 #ifdef __cplusplus 188 } 189 #endif 190 #endif 191