Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

342 lines
6.8 KiB

  1. /*++
  2. Copyright (c) 1995-1996 Microsoft Corporation
  3. Module Name :
  4. dynodbc.h
  5. Abstract:
  6. This header declares functions for dynamically loading ODBC.
  7. Author:
  8. Murali R. Krishnan ( MuraliK ) 3-Nov-1995
  9. Environment:
  10. Win32 -- User Mode
  11. Project:
  12. HTTPODBC
  13. Revision History:
  14. --*/
  15. # ifndef _DYNODBC_H_
  16. # define _DYNODBC_H_
  17. /************************************************************
  18. * Include Headers
  19. ************************************************************/
  20. //
  21. // SQL-ODBC interface headers
  22. //
  23. #include "sql.h"
  24. #include "sqlext.h"
  25. #include "sqltypes.h"
  26. /************************************************************
  27. * Dynamic Load support
  28. ************************************************************/
  29. BOOL
  30. DynLoadODBC(
  31. VOID
  32. );
  33. //
  34. // Prototypes form sql.h
  35. //
  36. typedef
  37. RETCODE
  38. ( SQL_API * pfnSQLAllocConnect )(
  39. HENV henv,
  40. HDBC FAR * phdbc
  41. );
  42. typedef
  43. RETCODE
  44. ( SQL_API * pfnSQLAllocEnv )(
  45. HENV FAR * phenv
  46. );
  47. typedef
  48. RETCODE
  49. ( SQL_API * pfnSQLAllocStmt )(
  50. HDBC hdbc,
  51. HSTMT FAR * phstmt
  52. );
  53. typedef
  54. RETCODE
  55. ( SQL_API * pfnSQLBindCol )(
  56. HSTMT hstmt,
  57. UWORD icol,
  58. SWORD fCType,
  59. PTR rgbValue,
  60. SDWORD cbValueMax,
  61. SDWORD FAR *pcbValue
  62. );
  63. typedef
  64. RETCODE
  65. ( SQL_API * pfnSQLCancel )(
  66. HSTMT hstmt
  67. );
  68. typedef
  69. RETCODE
  70. ( SQL_API * pfnSQLColAttributes )(
  71. HSTMT hstmt,
  72. UWORD icol,
  73. UWORD fDescType,
  74. PTR rgbDesc,
  75. SWORD cbDescMax,
  76. SWORD FAR *pcbDesc,
  77. SDWORD FAR *pfDesc
  78. );
  79. typedef
  80. RETCODE
  81. ( SQL_API * pfnSQLConnect )(
  82. HDBC hdbc,
  83. UCHAR FAR *szDSN,
  84. SWORD cbDSN,
  85. UCHAR FAR *szUID,
  86. SWORD cbUID,
  87. UCHAR FAR *szAuthStr,
  88. SWORD cbAuthStr
  89. );
  90. typedef
  91. RETCODE
  92. ( SQL_API * pfnSQLDescribeCol )(
  93. HSTMT hstmt,
  94. UWORD icol,
  95. UCHAR FAR *szColName,
  96. SWORD cbColNameMax,
  97. SWORD FAR *pcbColName,
  98. SWORD FAR *pfSqlType,
  99. UDWORD FAR *pcbColDef,
  100. SWORD FAR *pibScale,
  101. SWORD FAR *pfNullable
  102. );
  103. typedef
  104. RETCODE
  105. ( SQL_API * pfnSQLDisconnect )(
  106. HDBC hdbc
  107. );
  108. typedef
  109. RETCODE ( SQL_API * pfnSQLError )(
  110. HENV henv,
  111. HDBC hdbc,
  112. HSTMT hstmt,
  113. UCHAR FAR *szSqlState,
  114. SDWORD FAR *pfNativeError,
  115. UCHAR FAR *szErrorMsg,
  116. SWORD cbErrorMsgMax,
  117. SWORD FAR *pcbErrorMsg
  118. );
  119. typedef
  120. RETCODE
  121. ( SQL_API * pfnSQLExecDirect )(
  122. HSTMT hstmt,
  123. UCHAR FAR *szSqlStr,
  124. SDWORD cbSqlStr
  125. );
  126. typedef
  127. RETCODE
  128. ( SQL_API * pfnSQLExecute )(
  129. HSTMT hstmt
  130. );
  131. typedef
  132. RETCODE
  133. ( SQL_API * pfnSQLFetch )(
  134. HSTMT hstmt
  135. );
  136. typedef
  137. RETCODE
  138. ( SQL_API * pfnSQLFreeConnect )(
  139. HDBC hdbc
  140. );
  141. typedef
  142. RETCODE
  143. ( SQL_API * pfnSQLFreeEnv )(
  144. HENV henv
  145. );
  146. typedef
  147. RETCODE
  148. ( SQL_API * pfnSQLFreeStmt )(
  149. HSTMT hstmt,
  150. UWORD fOption
  151. );
  152. typedef
  153. RETCODE
  154. ( SQL_API * pfnSQLGetCursorName )(
  155. HSTMT hstmt,
  156. UCHAR FAR *szCursor,
  157. SWORD cbCursorMax,
  158. SWORD FAR *pcbCursor
  159. );
  160. typedef
  161. RETCODE
  162. ( SQL_API * pfnSQLNumResultCols )(
  163. HSTMT hstmt,
  164. SWORD FAR *pccol
  165. );
  166. typedef
  167. RETCODE
  168. ( SQL_API * pfnSQLPrepare )(
  169. HSTMT hstmt,
  170. UCHAR FAR *szSqlStr,
  171. SDWORD cbSqlStr
  172. );
  173. typedef
  174. RETCODE
  175. ( SQL_API * pfnSQLRowCount )(
  176. HSTMT hstmt,
  177. SDWORD FAR *pcrow
  178. );
  179. typedef
  180. RETCODE
  181. ( SQL_API * pfnSQLSetCursorName )(
  182. HSTMT hstmt,
  183. UCHAR FAR *szCursor,
  184. SWORD cbCursor
  185. );
  186. typedef
  187. RETCODE
  188. ( SQL_API * pfnSQLTransact )(
  189. HENV henv,
  190. HDBC hdbc,
  191. UWORD fType
  192. );
  193. //
  194. // Prototypes form sqlext.h
  195. //
  196. // Change to new prototype to get rid of 64-bit compile error
  197. typedef
  198. RETCODE
  199. ( SQL_API * pfnSQLSetConnectOption )(
  200. HDBC hdbc,
  201. UWORD fOption,
  202. SQLULEN vParam
  203. );
  204. typedef
  205. RETCODE
  206. ( SQL_API * pfnSQLDrivers )(
  207. HENV henv,
  208. UWORD fDirection,
  209. UCHAR FAR *szDriverDesc,
  210. SWORD cbDriverDescMax,
  211. SWORD FAR *pcbDriverDesc,
  212. UCHAR FAR *szDriverAttributes,
  213. SWORD cbDrvrAttrMax,
  214. SWORD FAR *pcbDrvrAttr
  215. );
  216. typedef
  217. RETCODE
  218. ( SQL_API * pfnSQLBindParameter )(
  219. HSTMT hstmt,
  220. UWORD ipar,
  221. SWORD fParamType,
  222. SWORD fCType,
  223. SWORD fSqlType,
  224. UDWORD cbColDef,
  225. SWORD ibScale,
  226. PTR rgbValue,
  227. SDWORD cbValueMax,
  228. SDWORD FAR *pcbValue
  229. );
  230. typedef
  231. RETCODE
  232. ( SQL_API * pfnSQLDataSources )(
  233. HENV henv,
  234. UWORD fDirection,
  235. UCHAR FAR *szDSN,
  236. SWORD cbDSNMax,
  237. SWORD FAR *pcbDSN,
  238. UCHAR FAR *szDescription,
  239. SWORD cbDescriptionMax,
  240. SWORD FAR *pcbDescription
  241. );
  242. typedef
  243. RETCODE
  244. ( SQL_API * pfnSQLGetInfo )(
  245. HDBC hdbc,
  246. UWORD fInfoType,
  247. PTR rgbInfoValue,
  248. SWORD cbInfoValueMax,
  249. SWORD FAR *pcbInfoValue
  250. );
  251. typedef
  252. RETCODE
  253. ( SQL_API * pfnSQLMoreResults )(
  254. HSTMT hstmt
  255. );
  256. /************************************************************
  257. * Variables
  258. ************************************************************/
  259. //
  260. // ODBC DLL Entry Points, fill by calling LoadODBC
  261. //
  262. extern pfnSQLAllocConnect pSQLAllocConnect ;
  263. extern pfnSQLAllocEnv pSQLAllocEnv ;
  264. extern pfnSQLAllocStmt pSQLAllocStmt ;
  265. extern pfnSQLBindCol pSQLBindCol ;
  266. extern pfnSQLCancel pSQLCancel ;
  267. extern pfnSQLColAttributes pSQLColAttributes ;
  268. extern pfnSQLConnect pSQLConnect ;
  269. extern pfnSQLDescribeCol pSQLDescribeCol ;
  270. extern pfnSQLDisconnect pSQLDisconnect ;
  271. extern pfnSQLError pSQLError ;
  272. extern pfnSQLExecDirect pSQLExecDirect ;
  273. extern pfnSQLExecute pSQLExecute ;
  274. extern pfnSQLFetch pSQLFetch ;
  275. extern pfnSQLFreeConnect pSQLFreeConnect ;
  276. extern pfnSQLFreeEnv pSQLFreeEnv ;
  277. extern pfnSQLFreeStmt pSQLFreeStmt ;
  278. extern pfnSQLGetCursorName pSQLGetCursorName ;
  279. extern pfnSQLNumResultCols pSQLNumResultCols ;
  280. extern pfnSQLPrepare pSQLPrepare ;
  281. extern pfnSQLRowCount pSQLRowCount ;
  282. extern pfnSQLSetCursorName pSQLSetCursorName ;
  283. extern pfnSQLTransact pSQLTransact ;
  284. extern pfnSQLSetConnectOption pSQLSetConnectOption;
  285. extern pfnSQLDrivers pSQLDrivers ;
  286. extern pfnSQLDataSources pSQLDataSources ;
  287. extern pfnSQLBindParameter pSQLBindParameter ;
  288. extern pfnSQLGetInfo pSQLGetInfo ;
  289. extern pfnSQLMoreResults pSQLMoreResults ;
  290. # endif // _DYNODBC_H_