/src/sqlncli.h

https://github.com/troyaaronjones/node-sqlserver · C Header · 4652 lines · 2673 code · 935 blank · 1044 comment · 64 complexity · 1f1fa246fbb033b4762c55f6a46af385 MD5 · raw file

  1. /* this ALWAYS GENERATED file contains the definitions for the interfaces */
  2. /* File created by MIDL compiler version 7.00.0555 */
  3. /* Compiler settings for sqlncli.idl:
  4. Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
  5. protocol : dce , ms_ext, c_ext, robust
  6. error checks: allocation ref bounds_check enum stub_data
  7. VC __declspec() decoration level:
  8. __declspec(uuid()), __declspec(selectany), __declspec(novtable)
  9. DECLSPEC_UUID(), MIDL_INTERFACE()
  10. */
  11. /* @@MIDL_FILE_HEADING( ) */
  12. #pragma warning( disable: 4049 ) /* more than 64k source lines */
  13. /* verify that the <rpcndr.h> version is high enough to compile this file*/
  14. #ifndef __REQUIRED_RPCNDR_H_VERSION__
  15. #define __REQUIRED_RPCNDR_H_VERSION__ 475
  16. #endif
  17. /* verify that the <rpcsal.h> version is high enough to compile this file*/
  18. #ifndef __REQUIRED_RPCSAL_H_VERSION__
  19. #define __REQUIRED_RPCSAL_H_VERSION__ 100
  20. #endif
  21. #include "rpc.h"
  22. #include "rpcndr.h"
  23. #ifndef __RPCNDR_H_VERSION__
  24. #error this stub requires an updated version of <rpcndr.h>
  25. #endif // __RPCNDR_H_VERSION__
  26. #ifndef COM_NO_WINDOWS_H
  27. #include "windows.h"
  28. #include "ole2.h"
  29. #endif /*COM_NO_WINDOWS_H*/
  30. #ifndef __sqlncli_h__
  31. #define __sqlncli_h__
  32. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  33. #pragma once
  34. #endif
  35. /* Forward Declarations */
  36. #ifndef __ICommandWithParameters_FWD_DEFINED__
  37. #define __ICommandWithParameters_FWD_DEFINED__
  38. typedef interface ICommandWithParameters ICommandWithParameters;
  39. #endif /* __ICommandWithParameters_FWD_DEFINED__ */
  40. #ifndef __IUMSInitialize_FWD_DEFINED__
  41. #define __IUMSInitialize_FWD_DEFINED__
  42. typedef interface IUMSInitialize IUMSInitialize;
  43. #endif /* __IUMSInitialize_FWD_DEFINED__ */
  44. #ifndef __ISQLServerErrorInfo_FWD_DEFINED__
  45. #define __ISQLServerErrorInfo_FWD_DEFINED__
  46. typedef interface ISQLServerErrorInfo ISQLServerErrorInfo;
  47. #endif /* __ISQLServerErrorInfo_FWD_DEFINED__ */
  48. #ifndef __IRowsetFastLoad_FWD_DEFINED__
  49. #define __IRowsetFastLoad_FWD_DEFINED__
  50. typedef interface IRowsetFastLoad IRowsetFastLoad;
  51. #endif /* __IRowsetFastLoad_FWD_DEFINED__ */
  52. #ifndef __ISchemaLock_FWD_DEFINED__
  53. #define __ISchemaLock_FWD_DEFINED__
  54. typedef interface ISchemaLock ISchemaLock;
  55. #endif /* __ISchemaLock_FWD_DEFINED__ */
  56. #ifndef __IBCPSession_FWD_DEFINED__
  57. #define __IBCPSession_FWD_DEFINED__
  58. typedef interface IBCPSession IBCPSession;
  59. #endif /* __IBCPSession_FWD_DEFINED__ */
  60. #ifndef __IBCPSession2_FWD_DEFINED__
  61. #define __IBCPSession2_FWD_DEFINED__
  62. typedef interface IBCPSession2 IBCPSession2;
  63. #endif /* __IBCPSession2_FWD_DEFINED__ */
  64. #ifndef __ISSAbort_FWD_DEFINED__
  65. #define __ISSAbort_FWD_DEFINED__
  66. typedef interface ISSAbort ISSAbort;
  67. #endif /* __ISSAbort_FWD_DEFINED__ */
  68. #ifndef __ISSCommandWithParameters_FWD_DEFINED__
  69. #define __ISSCommandWithParameters_FWD_DEFINED__
  70. typedef interface ISSCommandWithParameters ISSCommandWithParameters;
  71. #endif /* __ISSCommandWithParameters_FWD_DEFINED__ */
  72. #ifndef __IDBAsynchStatus_FWD_DEFINED__
  73. #define __IDBAsynchStatus_FWD_DEFINED__
  74. typedef interface IDBAsynchStatus IDBAsynchStatus;
  75. #endif /* __IDBAsynchStatus_FWD_DEFINED__ */
  76. #ifndef __ISSAsynchStatus_FWD_DEFINED__
  77. #define __ISSAsynchStatus_FWD_DEFINED__
  78. typedef interface ISSAsynchStatus ISSAsynchStatus;
  79. #endif /* __ISSAsynchStatus_FWD_DEFINED__ */
  80. /* header files for imported files */
  81. #include "unknwn.h"
  82. #include "oaidl.h"
  83. #ifdef __cplusplus
  84. extern "C"{
  85. #endif
  86. /* interface __MIDL_itf_sqlncli_0000_0000 */
  87. /* [local] */
  88. //-----------------------------------------------------------------------------
  89. // File: sqlncli.h
  90. //
  91. // Copyright: Copyright (c) Microsoft Corporation
  92. //
  93. // Contents: SQL Server Native Client OLEDB provider and ODBC driver specific
  94. // definitions.
  95. //
  96. //-----------------------------------------------------------------------------
  97. #if !defined(SQLNCLI_VER)
  98. #define SQLNCLI_VER 1100
  99. #endif
  100. #if SQLNCLI_VER >= 1100
  101. #define SQLNCLI_PRODUCT_NAME_FULL_VER_ANSI "Microsoft SQL Server Native Client 11.0"
  102. #define SQLNCLI_PRODUCT_NAME_FULL_ANSI "Microsoft SQL Server Native Client"
  103. #define SQLNCLI_PRODUCT_NAME_SHORT_VER_ANSI "SQL Server Native Client 11.0"
  104. #define SQLNCLI_PRODUCT_NAME_SHORT_ANSI "SQL Server Native Client"
  105. #define SQLNCLI_FILE_NAME_ANSI "sqlncli"
  106. #define SQLNCLI_FILE_NAME_VER_ANSI "sqlncli11"
  107. #define SQLNCLI_FILE_NAME_FULL_ANSI "sqlncli11.dll"
  108. #define SQLNCLI_PRODUCT_NAME_FULL_VER_UNICODE L"Microsoft SQL Server Native Client 11.0"
  109. #define SQLNCLI_PRODUCT_NAME_FULL_UNICODE L"Microsoft SQL Server Native Client"
  110. #define SQLNCLI_PRODUCT_NAME_SHORT_VER_UNICODE L"SQL Server Native Client 11.0"
  111. #define SQLNCLI_PRODUCT_NAME_SHORT_UNICODE L"SQL Server Native Client"
  112. #define SQLNCLI_FILE_NAME_UNICODE L"sqlncli"
  113. #define SQLNCLI_FILE_NAME_VER_UNICODE L"sqlncli11"
  114. #define SQLNCLI_FILE_NAME_FULL_UNICODE L"sqlncli11.dll"
  115. #if defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  116. #define SQLNCLI_VI_PROG_ID_ANSI "SQLNCLI11"
  117. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_ANSI "SQLNCLI11.ErrorLookup"
  118. #define SQLNCLI_VI_ENUMERATOR_PROG_ID_ANSI "SQLNCLI11.Enumerator"
  119. #define SQLNCLI_PROG_ID_ANSI "SQLNCLI11.1"
  120. #define SQLNCLI_ERROR_LOOKUP_PROG_ID_ANSI "SQLNCLI11.ErrorLookup.1"
  121. #define SQLNCLI_ENUMERATOR_PROG_ID_ANSI "SQLNCLI11.Enumerator.1"
  122. #define SQLNCLI_VI_PROG_ID_UNICODE L"SQLNCLI11"
  123. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_UNICODE L"SQLNCLI11.ErrorLookup"
  124. #define SQLNCLI_VI_ENUMERATOR_PROG_ID_UNICODE L"SQLNCLI11.Enumerator"
  125. #define SQLNCLI_PROG_ID_UNICODE L"SQLNCLI11.1"
  126. #define SQLNCLI_ERROR_LOOKUP_PROG_ID_UNICODE L"SQLNCLI11.ErrorLookup.1"
  127. #define SQLNCLI_ENUMERATOR_PROG_ID_UNICODE L"SQLNCLI11.Enumerator.1"
  128. #define SQLNCLI_CLSID CLSID_SQLNCLI11
  129. #define SQLNCLI_ERROR_CLSID CLSID_SQLNCLI11_ERROR
  130. #define SQLNCLI_ENUMERATOR_CLSID CLSID_SQLNCLI11_ENUMERATOR
  131. #endif // defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  132. #elif SQLNCLI_VER >= 1000
  133. #define SQLNCLI_PRODUCT_NAME_FULL_VER_ANSI "Microsoft SQL Server Native Client 10.0"
  134. #define SQLNCLI_PRODUCT_NAME_FULL_ANSI "Microsoft SQL Server Native Client"
  135. #define SQLNCLI_PRODUCT_NAME_SHORT_VER_ANSI "SQL Server Native Client 10.0"
  136. #define SQLNCLI_PRODUCT_NAME_SHORT_ANSI "SQL Server Native Client"
  137. #define SQLNCLI_FILE_NAME_ANSI "sqlncli"
  138. #define SQLNCLI_FILE_NAME_VER_ANSI "sqlncli10"
  139. #define SQLNCLI_FILE_NAME_FULL_ANSI "sqlncli10.dll"
  140. #define SQLNCLI_PRODUCT_NAME_FULL_VER_UNICODE L"Microsoft SQL Server Native Client 10.0"
  141. #define SQLNCLI_PRODUCT_NAME_FULL_UNICODE L"Microsoft SQL Server Native Client"
  142. #define SQLNCLI_PRODUCT_NAME_SHORT_VER_UNICODE L"SQL Server Native Client 10.0"
  143. #define SQLNCLI_PRODUCT_NAME_SHORT_UNICODE L"SQL Server Native Client"
  144. #define SQLNCLI_FILE_NAME_UNICODE L"sqlncli"
  145. #define SQLNCLI_FILE_NAME_VER_UNICODE L"sqlncli10"
  146. #define SQLNCLI_FILE_NAME_FULL_UNICODE L"sqlncli10.dll"
  147. #if defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  148. #define SQLNCLI_VI_PROG_ID_ANSI "SQLNCLI10"
  149. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_ANSI "SQLNCLI10 ErrorLookup"
  150. #define SQLNCLI_VI_ENUMERATOR_PROG_ID_ANSI "SQLNCLI10 Enumerator"
  151. #define SQLNCLI_PROG_ID_ANSI "SQLNCLI10.1"
  152. #define SQLNCLI_ERROR_LOOKUP_PROG_ID_ANSI "SQLNCLI10 ErrorLookup.1"
  153. #define SQLNCLI_ENUMERATOR_PROG_ID_ANSI "SQLNCLI10 Enumerator.1"
  154. #define SQLNCLI_VI_PROG_ID_UNICODE L"SQLNCLI10"
  155. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_UNICODE L"SQLNCLI10 ErrorLookup"
  156. #define SQLNCLI_VI_ENUMERATOR_PROG_ID_UNICODE L"SQLNCLI10 Enumerator"
  157. #define SQLNCLI_PROG_ID_UNICODE L"SQLNCLI10.1"
  158. #define SQLNCLI_ERROR_LOOKUP_PROG_ID_UNICODE L"SQLNCLI10 ErrorLookup.1"
  159. #define SQLNCLI_ENUMERATOR_PROG_ID_UNICODE L"SQLNCLI10 Enumerator.1"
  160. #define SQLNCLI_CLSID CLSID_SQLNCLI10
  161. #define SQLNCLI_ERROR_CLSID CLSID_SQLNCLI10_ERROR
  162. #define SQLNCLI_ENUMERATOR_CLSID CLSID_SQLNCLI10_ENUMERATOR
  163. #endif // defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  164. #else
  165. #define SQLNCLI_PRODUCT_NAME_FULL_VER_ANSI "Microsoft SQL Server Native Client"
  166. #define SQLNCLI_PRODUCT_NAME_FULL_ANSI "Microsoft SQL Server Native Client"
  167. #define SQLNCLI_PRODUCT_NAME_SHORT_VER_ANSI "SQL Native Client"
  168. #define SQLNCLI_PRODUCT_NAME_SHORT_ANSI "SQL Native Client"
  169. #define SQLNCLI_FILE_NAME_ANSI "sqlncli"
  170. #define SQLNCLI_FILE_NAME_VER_ANSI "sqlncli"
  171. #define SQLNCLI_FILE_NAME_FULL_ANSI "sqlncli.dll"
  172. #define SQLNCLI_PRODUCT_NAME_FULL_VER_UNICODE L"Microsoft SQL Server Native Client"
  173. #define SQLNCLI_PRODUCT_NAME_FULL_UNICODE L"Microsoft SQL Server Native Client"
  174. #define SQLNCLI_PRODUCT_NAME_SHORT_VER_UNICODE L"SQL Native Client"
  175. #define SQLNCLI_PRODUCT_NAME_SHORT_UNICODE L"SQL Native Client"
  176. #define SQLNCLI_FILE_NAME_UNICODE L"sqlncli"
  177. #define SQLNCLI_FILE_NAME_VER_UNICODE L"sqlncli"
  178. #define SQLNCLI_FILE_NAME_FULL_UNICODE L"sqlncli.dll"
  179. #if defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  180. #define SQLNCLI_VI_PROG_ID_ANSI "SQLNCLI"
  181. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_ANSI "SQLNCLI ErrorLookup"
  182. #define SQLNCLI_VI_ENUMERATOR_PROG_ID_ANSI "SQLNCLI Enumerator"
  183. #define SQLNCLI_PROG_ID_ANSI "SQLNCLI.1"
  184. #define SQLNCLI_ERROR_LOOKUP_PROG_ID_ANSI "SQLNCLI ErrorLookup.1"
  185. #define SQLNCLI_ENUMERATOR_PROG_ID_ANSI "SQLNCLI Enumerator.1"
  186. #define SQLNCLI_VI_PROG_ID_UNICODE L"SQLNCLI"
  187. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_UNICODE L"SQLNCLI ErrorLookup"
  188. #define SQLNCLI_VI_ENUMERATOR_PROG_ID_UNICODE L"SQLNCLI Enumerator"
  189. #define SQLNCLI_PROG_ID_UNICODE L"SQLNCLI.1"
  190. #define SQLNCLI_ERROR_LOOKUP_PROG_ID_UNICODE L"SQLNCLI ErrorLookup.1"
  191. #define SQLNCLI_ENUMERATOR_PROG_ID_UNICODE L"SQLNCLI Enumerator.1"
  192. #define SQLNCLI_CLSID CLSID_SQLNCLI
  193. #define SQLNCLI_ERROR_CLSID CLSID_SQLNCLI_ERROR
  194. #define SQLNCLI_ENUMERATOR_CLSID CLSID_SQLNCLI_ENUMERATOR
  195. #endif // defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  196. #endif // SQLNCLI_VER >= 1100
  197. // define the character type agnostic constants
  198. #if defined(_UNICODE) || defined(UNICODE)
  199. #define SQLNCLI_PRODUCT_NAME_FULL_VER SQLNCLI_PRODUCT_NAME_FULL_VER_UNICODE
  200. #define SQLNCLI_PRODUCT_NAME_FULL SQLNCLI_PRODUCT_NAME_FULL_UNICODE
  201. #define SQLNCLI_PRODUCT_NAME_SHORT_VER SQLNCLI_PRODUCT_NAME_SHORT_VER_UNICODE
  202. #define SQLNCLI_PRODUCT_NAME_SHORT SQLNCLI_PRODUCT_NAME_SHORT_UNICODE
  203. #define SQLNCLI_FILE_NAME SQLNCLI_FILE_NAME_UNICODE
  204. #define SQLNCLI_FILE_NAME_VER SQLNCLI_FILE_NAME_VER_UNICODE
  205. #define SQLNCLI_FILE_NAME_FULL SQLNCLI_FILE_NAME_FULL_UNICODE
  206. #if defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  207. #define SQLNCLI_VI_PROG_ID SQLNCLI_VI_PROG_ID_UNICODE
  208. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_UNICODE
  209. #define SQLNCLI_VI_ENUMERATOR_PROG_ID SQLNCLI_VI_ENUMERATOR_PROG_ID_UNICODE
  210. #define SQLNCLI_PROG_ID SQLNCLI_PROG_ID_UNICODE
  211. #define SQLNCLI_ERROR_LOOKUP_PROG_ID SQLNCLI_ERROR_LOOKUP_PROG_ID_UNICODE
  212. #define SQLNCLI_ENUMERATOR_PROG_ID SQLNCLI_ENUMERATOR_PROG_ID_UNICODE
  213. #endif // defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  214. #else // _UNICODE || UNICODE
  215. #define SQLNCLI_PRODUCT_NAME_FULL_VER SQLNCLI_PRODUCT_NAME_FULL_VER_ANSI
  216. #define SQLNCLI_PRODUCT_NAME_FULL SQLNCLI_PRODUCT_NAME_FULL_ANSI
  217. #define SQLNCLI_PRODUCT_NAME_SHORT_VER SQLNCLI_PRODUCT_NAME_SHORT_VER_ANSI
  218. #define SQLNCLI_PRODUCT_NAME_SHORT SQLNCLI_PRODUCT_NAME_SHORT_ANSI
  219. #define SQLNCLI_FILE_NAME SQLNCLI_FILE_NAME_ANSI
  220. #define SQLNCLI_FILE_NAME_VER SQLNCLI_FILE_NAME_VER_ANSI
  221. #define SQLNCLI_FILE_NAME_FULL SQLNCLI_FILE_NAME_FULL_ANSI
  222. #if defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  223. #define SQLNCLI_VI_PROG_ID SQLNCLI_VI_PROG_ID_ANSI
  224. #define SQLNCLI_VI_ERROR_LOOKUP_PROG_ID SQLNCLI_VI_ERROR_LOOKUP_PROG_ID_ANSI
  225. #define SQLNCLI_VI_ENUMERATOR_PROG_ID SQLNCLI_VI_ENUMERATOR_PROG_ID_ANSI
  226. #define SQLNCLI_PROG_ID SQLNCLI_PROG_ID_ANSI
  227. #define SQLNCLI_ERROR_LOOKUP_PROG_ID SQLNCLI_ERROR_LOOKUP_PROG_ID_ANSI
  228. #define SQLNCLI_ENUMERATOR_PROG_ID SQLNCLI_ENUMERATOR_PROG_ID_ANSI
  229. #endif // defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  230. #endif // _UNICODE || UNICODE
  231. #if defined(_SQLNCLI_ODBC_) || !defined(_SQLNCLI_OLEDB_)
  232. #define SQLNCLI_DRIVER_NAME SQLNCLI_PRODUCT_NAME_SHORT_VER
  233. #endif
  234. // OLEDB part of SQL Server Native Client header - begin here
  235. #if defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  236. #ifndef __oledb_h__
  237. #include <oledb.h>
  238. #endif /*__oledb_h__*/
  239. #if 0 // This is already defined in oledb.h
  240. #ifdef _WIN64
  241. // Length of a non-character object, size
  242. typedef ULONGLONG DBLENGTH;
  243. // Offset within a rowset
  244. typedef LONGLONG DBROWOFFSET;
  245. // Number of rows
  246. typedef LONGLONG DBROWCOUNT;
  247. typedef ULONGLONG DBCOUNTITEM;
  248. // Ordinal (column number, etc.)
  249. typedef ULONGLONG DBORDINAL;
  250. typedef LONGLONG DB_LORDINAL;
  251. // Bookmarks
  252. typedef ULONGLONG DBBKMARK;
  253. // Offset in the buffer
  254. typedef ULONGLONG DBBYTEOFFSET;
  255. // Reference count of each row/accessor handle
  256. typedef ULONG DBREFCOUNT;
  257. // Parameters
  258. typedef ULONGLONG DB_UPARAMS;
  259. typedef LONGLONG DB_LPARAMS;
  260. // hash values corresponding to the elements (bookmarks)
  261. typedef DWORDLONG DBHASHVALUE;
  262. // For reserve
  263. typedef DWORDLONG DB_DWRESERVE;
  264. typedef LONGLONG DB_LRESERVE;
  265. typedef ULONGLONG DB_URESERVE;
  266. #else //_WIN64
  267. // Length of a non-character object, size
  268. typedef ULONG DBLENGTH;
  269. // Offset within a rowset
  270. typedef LONG DBROWOFFSET;
  271. // Number of rows
  272. typedef LONG DBROWCOUNT;
  273. typedef ULONG DBCOUNTITEM;
  274. // Ordinal (column number, etc.)
  275. typedef ULONG DBORDINAL;
  276. typedef LONG DB_LORDINAL;
  277. // Bookmarks
  278. typedef ULONG DBBKMARK;
  279. // Offset in the buffer
  280. typedef ULONG DBBYTEOFFSET;
  281. // Reference count of each row handle
  282. typedef ULONG DBREFCOUNT;
  283. // Parameters
  284. typedef ULONG DB_UPARAMS;
  285. typedef LONG DB_LPARAMS;
  286. // hash values corresponding to the elements (bookmarks)
  287. typedef DWORD DBHASHVALUE;
  288. // For reserve
  289. typedef DWORD DB_DWRESERVE;
  290. typedef LONG DB_LRESERVE;
  291. typedef ULONG DB_URESERVE;
  292. #endif // _WIN64
  293. typedef DWORD DBKIND;
  294. enum DBKINDENUM
  295. { DBKIND_GUID_NAME = 0,
  296. DBKIND_GUID_PROPID = ( DBKIND_GUID_NAME + 1 ) ,
  297. DBKIND_NAME = ( DBKIND_GUID_PROPID + 1 ) ,
  298. DBKIND_PGUID_NAME = ( DBKIND_NAME + 1 ) ,
  299. DBKIND_PGUID_PROPID = ( DBKIND_PGUID_NAME + 1 ) ,
  300. DBKIND_PROPID = ( DBKIND_PGUID_PROPID + 1 ) ,
  301. DBKIND_GUID = ( DBKIND_PROPID + 1 )
  302. } ;
  303. typedef struct tagDBID
  304. {
  305. union
  306. {
  307. GUID guid;
  308. GUID *pguid;
  309. /* Empty union arm */
  310. } uGuid;
  311. DBKIND eKind;
  312. union
  313. {
  314. LPOLESTR pwszName;
  315. ULONG ulPropid;
  316. /* Empty union arm */
  317. } uName;
  318. } DBID;
  319. typedef struct tagDB_NUMERIC
  320. {
  321. BYTE precision;
  322. BYTE scale;
  323. BYTE sign;
  324. BYTE val[ 16 ];
  325. } DB_NUMERIC;
  326. typedef struct tagDBDATE
  327. {
  328. SHORT year;
  329. USHORT month;
  330. USHORT day;
  331. } DBDATE;
  332. typedef struct tagDBTIME
  333. {
  334. USHORT hour;
  335. USHORT minute;
  336. USHORT second;
  337. } DBTIME;
  338. typedef struct tagDBTIMESTAMP
  339. {
  340. SHORT year;
  341. USHORT month;
  342. USHORT day;
  343. USHORT hour;
  344. USHORT minute;
  345. USHORT second;
  346. ULONG fraction;
  347. } DBTIMESTAMP;
  348. typedef struct tagDBOBJECT
  349. {
  350. DWORD dwFlags;
  351. IID iid;
  352. } DBOBJECT;
  353. typedef WORD DBTYPE;
  354. typedef ULONG_PTR HACCESSOR;
  355. typedef ULONG_PTR HCHAPTER;
  356. typedef DWORD DBPARAMFLAGS;
  357. typedef struct tagDBPARAMINFO
  358. {
  359. DBPARAMFLAGS dwFlags;
  360. DBORDINAL iOrdinal;
  361. LPOLESTR pwszName;
  362. ITypeInfo *pTypeInfo;
  363. DBLENGTH ulParamSize;
  364. DBTYPE wType;
  365. BYTE bPrecision;
  366. BYTE bScale;
  367. } DBPARAMINFO;
  368. typedef DWORD DBPROPID;
  369. typedef struct tagDBPROPIDSET
  370. {
  371. DBPROPID *rgPropertyIDs;
  372. ULONG cPropertyIDs;
  373. GUID guidPropertySet;
  374. } DBPROPIDSET;
  375. typedef DWORD DBPROPFLAGS;
  376. typedef DWORD DBPROPOPTIONS;
  377. typedef DWORD DBPROPSTATUS;
  378. typedef struct tagDBPROP
  379. {
  380. DBPROPID dwPropertyID;
  381. DBPROPOPTIONS dwOptions;
  382. DBPROPSTATUS dwStatus;
  383. DBID colid;
  384. VARIANT vValue;
  385. } DBPROP;
  386. typedef struct tagDBPROPSET
  387. {
  388. DBPROP *rgProperties;
  389. ULONG cProperties;
  390. GUID guidPropertySet;
  391. } DBPROPSET;
  392. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0000_v0_0_c_ifspec;
  393. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0000_v0_0_s_ifspec;
  394. #ifndef __ICommandWithParameters_INTERFACE_DEFINED__
  395. #define __ICommandWithParameters_INTERFACE_DEFINED__
  396. /* interface ICommandWithParameters */
  397. /* [unique][uuid][object][local] */
  398. typedef struct tagDBPARAMBINDINFO
  399. {
  400. LPOLESTR pwszDataSourceType;
  401. LPOLESTR pwszName;
  402. DBLENGTH ulParamSize;
  403. DBPARAMFLAGS dwFlags;
  404. BYTE bPrecision;
  405. BYTE bScale;
  406. } DBPARAMBINDINFO;
  407. EXTERN_C const IID IID_ICommandWithParameters;
  408. #if defined(__cplusplus) && !defined(CINTERFACE)
  409. MIDL_INTERFACE("0c733a64-2a1c-11ce-ade5-00aa0044773d")
  410. ICommandWithParameters : public IUnknown
  411. {
  412. public:
  413. virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetParameterInfo(
  414. /* [out][in] */ DB_UPARAMS *pcParams,
  415. /* [size_is][size_is][out] */ DBPARAMINFO **prgParamInfo,
  416. /* [out] */ OLECHAR **ppNamesBuffer) = 0;
  417. virtual /* [local] */ HRESULT STDMETHODCALLTYPE MapParameterNames(
  418. /* [in] */ DB_UPARAMS cParamNames,
  419. /* [size_is][in] */ const OLECHAR *rgParamNames[ ],
  420. /* [size_is][out] */ DB_LPARAMS rgParamOrdinals[ ]) = 0;
  421. virtual /* [local] */ HRESULT STDMETHODCALLTYPE SetParameterInfo(
  422. /* [in] */ DB_UPARAMS cParams,
  423. /* [size_is][unique][in] */ const DB_UPARAMS rgParamOrdinals[ ],
  424. /* [size_is][unique][in] */ const DBPARAMBINDINFO rgParamBindInfo[ ]) = 0;
  425. };
  426. #else /* C style interface */
  427. typedef struct ICommandWithParametersVtbl
  428. {
  429. BEGIN_INTERFACE
  430. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  431. ICommandWithParameters * This,
  432. /* [in] */ REFIID riid,
  433. /* [annotation][iid_is][out] */
  434. __RPC__deref_out void **ppvObject);
  435. ULONG ( STDMETHODCALLTYPE *AddRef )(
  436. ICommandWithParameters * This);
  437. ULONG ( STDMETHODCALLTYPE *Release )(
  438. ICommandWithParameters * This);
  439. /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetParameterInfo )(
  440. ICommandWithParameters * This,
  441. /* [out][in] */ DB_UPARAMS *pcParams,
  442. /* [size_is][size_is][out] */ DBPARAMINFO **prgParamInfo,
  443. /* [out] */ OLECHAR **ppNamesBuffer);
  444. /* [local] */ HRESULT ( STDMETHODCALLTYPE *MapParameterNames )(
  445. ICommandWithParameters * This,
  446. /* [in] */ DB_UPARAMS cParamNames,
  447. /* [size_is][in] */ const OLECHAR *rgParamNames[ ],
  448. /* [size_is][out] */ DB_LPARAMS rgParamOrdinals[ ]);
  449. /* [local] */ HRESULT ( STDMETHODCALLTYPE *SetParameterInfo )(
  450. ICommandWithParameters * This,
  451. /* [in] */ DB_UPARAMS cParams,
  452. /* [size_is][unique][in] */ const DB_UPARAMS rgParamOrdinals[ ],
  453. /* [size_is][unique][in] */ const DBPARAMBINDINFO rgParamBindInfo[ ]);
  454. END_INTERFACE
  455. } ICommandWithParametersVtbl;
  456. interface ICommandWithParameters
  457. {
  458. CONST_VTBL struct ICommandWithParametersVtbl *lpVtbl;
  459. };
  460. #ifdef COBJMACROS
  461. #define ICommandWithParameters_QueryInterface(This,riid,ppvObject) \
  462. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  463. #define ICommandWithParameters_AddRef(This) \
  464. ( (This)->lpVtbl -> AddRef(This) )
  465. #define ICommandWithParameters_Release(This) \
  466. ( (This)->lpVtbl -> Release(This) )
  467. #define ICommandWithParameters_GetParameterInfo(This,pcParams,prgParamInfo,ppNamesBuffer) \
  468. ( (This)->lpVtbl -> GetParameterInfo(This,pcParams,prgParamInfo,ppNamesBuffer) )
  469. #define ICommandWithParameters_MapParameterNames(This,cParamNames,rgParamNames,rgParamOrdinals) \
  470. ( (This)->lpVtbl -> MapParameterNames(This,cParamNames,rgParamNames,rgParamOrdinals) )
  471. #define ICommandWithParameters_SetParameterInfo(This,cParams,rgParamOrdinals,rgParamBindInfo) \
  472. ( (This)->lpVtbl -> SetParameterInfo(This,cParams,rgParamOrdinals,rgParamBindInfo) )
  473. #endif /* COBJMACROS */
  474. #endif /* C style interface */
  475. /* [call_as] */ HRESULT STDMETHODCALLTYPE ICommandWithParameters_RemoteGetParameterInfo_Proxy(
  476. ICommandWithParameters * This,
  477. /* [out][in] */ DB_UPARAMS *pcParams,
  478. /* [size_is][size_is][out] */ DBPARAMINFO **prgParamInfo,
  479. /* [size_is][size_is][out] */ DBBYTEOFFSET **prgNameOffsets,
  480. /* [out][in] */ DBLENGTH *pcbNamesBuffer,
  481. /* [size_is][size_is][unique][out][in] */ OLECHAR **ppNamesBuffer,
  482. /* [out] */ IErrorInfo **ppErrorInfoRem);
  483. void __RPC_STUB ICommandWithParameters_RemoteGetParameterInfo_Stub(
  484. IRpcStubBuffer *This,
  485. IRpcChannelBuffer *_pRpcChannelBuffer,
  486. PRPC_MESSAGE _pRpcMessage,
  487. DWORD *_pdwStubPhase);
  488. /* [call_as] */ HRESULT STDMETHODCALLTYPE ICommandWithParameters_RemoteMapParameterNames_Proxy(
  489. ICommandWithParameters * This,
  490. /* [in] */ DB_UPARAMS cParamNames,
  491. /* [size_is][in] */ LPCOLESTR *rgParamNames,
  492. /* [size_is][out] */ DB_LPARAMS *rgParamOrdinals,
  493. /* [out] */ IErrorInfo **ppErrorInfoRem);
  494. void __RPC_STUB ICommandWithParameters_RemoteMapParameterNames_Stub(
  495. IRpcStubBuffer *This,
  496. IRpcChannelBuffer *_pRpcChannelBuffer,
  497. PRPC_MESSAGE _pRpcMessage,
  498. DWORD *_pdwStubPhase);
  499. /* [call_as] */ HRESULT STDMETHODCALLTYPE ICommandWithParameters_RemoteSetParameterInfo_Proxy(
  500. ICommandWithParameters * This,
  501. /* [in] */ DB_UPARAMS cParams,
  502. /* [size_is][unique][in] */ const DB_UPARAMS *rgParamOrdinals,
  503. /* [size_is][unique][in] */ const DBPARAMBINDINFO *rgParamBindInfo,
  504. /* [out] */ IErrorInfo **ppErrorInfoRem);
  505. void __RPC_STUB ICommandWithParameters_RemoteSetParameterInfo_Stub(
  506. IRpcStubBuffer *This,
  507. IRpcChannelBuffer *_pRpcChannelBuffer,
  508. PRPC_MESSAGE _pRpcMessage,
  509. DWORD *_pdwStubPhase);
  510. #endif /* __ICommandWithParameters_INTERFACE_DEFINED__ */
  511. /* interface __MIDL_itf_sqlncli_0000_0001 */
  512. /* [local] */
  513. typedef DWORD DBASYNCHOP;
  514. typedef DWORD DBASYNCHPHASE;
  515. #endif // This is already defined in oledb.h
  516. //-------------------------------------------------------------------
  517. // Variant Access macros, similar to ole automation.
  518. //-------------------------------------------------------------------
  519. #define V_SS_VT(X) ((X)->vt)
  520. #define V_SS_UNION(X, Y) ((X)->Y)
  521. #define V_SS_UI1(X) V_SS_UNION(X, bTinyIntVal)
  522. #define V_SS_I2(X) V_SS_UNION(X, sShortIntVal)
  523. #define V_SS_I4(X) V_SS_UNION(X, lIntVal)
  524. #define V_SS_I8(X) V_SS_UNION(X, llBigIntVal)
  525. #define V_SS_R4(X) V_SS_UNION(X, fltRealVal)
  526. #define V_SS_R8(X) V_SS_UNION(X, dblFloatVal)
  527. #define V_SS_UI4(X) V_SS_UNION(X, ulVal)
  528. #define V_SS_MONEY(X) V_SS_UNION(X, cyMoneyVal)
  529. #define V_SS_SMALLMONEY(X) V_SS_UNION(X, cyMoneyVal)
  530. #define V_SS_WSTRING(X) V_SS_UNION(X, NCharVal)
  531. #define V_SS_WVARSTRING(X) V_SS_UNION(X, NCharVal)
  532. #define V_SS_STRING(X) V_SS_UNION(X, CharVal)
  533. #define V_SS_VARSTRING(X) V_SS_UNION(X, CharVal)
  534. #define V_SS_BIT(X) V_SS_UNION(X, fBitVal)
  535. #define V_SS_GUID(X) V_SS_UNION(X, rgbGuidVal)
  536. #define V_SS_NUMERIC(X) V_SS_UNION(X, numNumericVal)
  537. #define V_SS_DECIMAL(X) V_SS_UNION(X, numNumericVal)
  538. #define V_SS_BINARY(X) V_SS_UNION(X, BinaryVal)
  539. #define V_SS_VARBINARY(X) V_SS_UNION(X, BinaryVal)
  540. #define V_SS_DATETIME(X) V_SS_UNION(X, tsDateTimeVal)
  541. #define V_SS_SMALLDATETIME(X) V_SS_UNION(X, tsDateTimeVal)
  542. #define V_SS_UNKNOWN(X) V_SS_UNION(X, UnknownType)
  543. //Text and image types.
  544. #define V_SS_IMAGE(X) V_SS_UNION(X, ImageVal)
  545. #define V_SS_TEXT(X) V_SS_UNION(X, TextVal)
  546. #define V_SS_NTEXT(X) V_SS_UNION(X, NTextVal)
  547. //Microsoft SQL Server 2008 datetime.
  548. #define V_SS_DATE(X) V_SS_UNION(X, dDateVal)
  549. #define V_SS_TIME2(X) V_SS_UNION(X, Time2Val)
  550. #define V_SS_DATETIME2(X) V_SS_UNION(X, DateTimeVal)
  551. #define V_SS_DATETIMEOFFSET(X) V_SS_UNION(X, DateTimeOffsetVal)
  552. //-------------------------------------------------------------------
  553. // define SQL Server specific types.
  554. //-------------------------------------------------------------------
  555. typedef enum DBTYPEENUM EOledbTypes;
  556. #define DBTYPE_XML ((EOledbTypes) 141) // introduced in SQL 2005
  557. #define DBTYPE_TABLE ((EOledbTypes) 143) // introduced in SQL 2008
  558. #define DBTYPE_DBTIME2 ((EOledbTypes) 145) // introduced in SQL 2008
  559. #define DBTYPE_DBTIMESTAMPOFFSET ((EOledbTypes) 146) // introduced in SQL 2008
  560. #ifdef _SQLOLEDB_H_
  561. #undef DBTYPE_SQLVARIANT
  562. #endif //_SQLOLEDB_H_
  563. #define DBTYPE_SQLVARIANT ((EOledbTypes) 144) // introduced in MDAC 2.5
  564. #ifndef _SQLOLEDB_H_
  565. enum SQLVARENUM
  566. {
  567. VT_SS_EMPTY = DBTYPE_EMPTY,
  568. VT_SS_NULL = DBTYPE_NULL,
  569. VT_SS_UI1 = DBTYPE_UI1,
  570. VT_SS_I2 = DBTYPE_I2,
  571. VT_SS_I4 = DBTYPE_I4,
  572. VT_SS_I8 = DBTYPE_I8,
  573. //Floats
  574. VT_SS_R4 = DBTYPE_R4,
  575. VT_SS_R8 = DBTYPE_R8,
  576. //Money
  577. VT_SS_MONEY = DBTYPE_CY,
  578. VT_SS_SMALLMONEY = 200,
  579. //Strings
  580. VT_SS_WSTRING = 201,
  581. VT_SS_WVARSTRING = 202,
  582. VT_SS_STRING = 203,
  583. VT_SS_VARSTRING = 204,
  584. //Bit
  585. VT_SS_BIT = DBTYPE_BOOL,
  586. //Guid
  587. VT_SS_GUID = DBTYPE_GUID,
  588. //Exact precision
  589. VT_SS_NUMERIC = DBTYPE_NUMERIC,
  590. VT_SS_DECIMAL = 205,
  591. //Datetime
  592. VT_SS_DATETIME = DBTYPE_DBTIMESTAMP,
  593. VT_SS_SMALLDATETIME =206,
  594. //Binary
  595. VT_SS_BINARY =207,
  596. VT_SS_VARBINARY = 208,
  597. //Future
  598. VT_SS_UNKNOWN = 209,
  599. //Additional datetime
  600. VT_SS_DATE = DBTYPE_DBDATE,
  601. VT_SS_TIME2 = DBTYPE_DBTIME2,
  602. VT_SS_DATETIME2 = 212,
  603. VT_SS_DATETIMEOFFSET = DBTYPE_DBTIMESTAMPOFFSET,
  604. };
  605. typedef unsigned short SSVARTYPE;
  606. enum DBPARAMFLAGSENUM_SS_100
  607. { DBPARAMFLAGS_SS_ISVARIABLESCALE = 0x40000000
  608. } ;
  609. enum DBCOLUMNFLAGSENUM_SS_100
  610. { DBCOLUMNFLAGS_SS_ISVARIABLESCALE = 0x40000000,
  611. DBCOLUMNFLAGS_SS_ISCOLUMNSET = 0x80000000
  612. } ;
  613. //-------------------------------------------------------------------
  614. // Class Factory Interface used to initialize pointer to UMS.
  615. //-------------------------------------------------------------------
  616. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0001_v0_0_c_ifspec;
  617. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0001_v0_0_s_ifspec;
  618. #ifndef __IUMSInitialize_INTERFACE_DEFINED__
  619. #define __IUMSInitialize_INTERFACE_DEFINED__
  620. /* interface IUMSInitialize */
  621. /* [unique][uuid][object][local] */
  622. EXTERN_C const IID IID_IUMSInitialize;
  623. #if defined(__cplusplus) && !defined(CINTERFACE)
  624. MIDL_INTERFACE("5cf4ca14-ef21-11d0-97e7-00c04fc2ad98")
  625. IUMSInitialize : public IUnknown
  626. {
  627. public:
  628. virtual HRESULT STDMETHODCALLTYPE Initialize(
  629. /* [in] */ void *pUMS) = 0;
  630. };
  631. #else /* C style interface */
  632. typedef struct IUMSInitializeVtbl
  633. {
  634. BEGIN_INTERFACE
  635. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  636. IUMSInitialize * This,
  637. /* [in] */ REFIID riid,
  638. /* [annotation][iid_is][out] */
  639. __RPC__deref_out void **ppvObject);
  640. ULONG ( STDMETHODCALLTYPE *AddRef )(
  641. IUMSInitialize * This);
  642. ULONG ( STDMETHODCALLTYPE *Release )(
  643. IUMSInitialize * This);
  644. HRESULT ( STDMETHODCALLTYPE *Initialize )(
  645. IUMSInitialize * This,
  646. /* [in] */ void *pUMS);
  647. END_INTERFACE
  648. } IUMSInitializeVtbl;
  649. interface IUMSInitialize
  650. {
  651. CONST_VTBL struct IUMSInitializeVtbl *lpVtbl;
  652. };
  653. #ifdef COBJMACROS
  654. #define IUMSInitialize_QueryInterface(This,riid,ppvObject) \
  655. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  656. #define IUMSInitialize_AddRef(This) \
  657. ( (This)->lpVtbl -> AddRef(This) )
  658. #define IUMSInitialize_Release(This) \
  659. ( (This)->lpVtbl -> Release(This) )
  660. #define IUMSInitialize_Initialize(This,pUMS) \
  661. ( (This)->lpVtbl -> Initialize(This,pUMS) )
  662. #endif /* COBJMACROS */
  663. #endif /* C style interface */
  664. #endif /* __IUMSInitialize_INTERFACE_DEFINED__ */
  665. /* interface __MIDL_itf_sqlncli_0000_0002 */
  666. /* [local] */
  667. // the structure returned by ISQLServerErrorInfo::GetSQLServerInfo
  668. typedef struct tagSSErrorInfo
  669. {
  670. LPOLESTR pwszMessage;
  671. LPOLESTR pwszServer;
  672. LPOLESTR pwszProcedure;
  673. LONG lNative;
  674. BYTE bState;
  675. BYTE bClass;
  676. WORD wLineNumber;
  677. } SSERRORINFO;
  678. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0002_v0_0_c_ifspec;
  679. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0002_v0_0_s_ifspec;
  680. #ifndef __ISQLServerErrorInfo_INTERFACE_DEFINED__
  681. #define __ISQLServerErrorInfo_INTERFACE_DEFINED__
  682. /* interface ISQLServerErrorInfo */
  683. /* [unique][uuid][object][local] */
  684. EXTERN_C const IID IID_ISQLServerErrorInfo;
  685. #if defined(__cplusplus) && !defined(CINTERFACE)
  686. MIDL_INTERFACE("5CF4CA12-EF21-11d0-97E7-00C04FC2AD98")
  687. ISQLServerErrorInfo : public IUnknown
  688. {
  689. public:
  690. virtual HRESULT STDMETHODCALLTYPE GetErrorInfo(
  691. /* [out] */ SSERRORINFO **ppErrorInfo,
  692. /* [annotation][out] */
  693. __deref_out OLECHAR **ppStringsBuffer) = 0;
  694. };
  695. #else /* C style interface */
  696. typedef struct ISQLServerErrorInfoVtbl
  697. {
  698. BEGIN_INTERFACE
  699. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  700. ISQLServerErrorInfo * This,
  701. /* [in] */ REFIID riid,
  702. /* [annotation][iid_is][out] */
  703. __RPC__deref_out void **ppvObject);
  704. ULONG ( STDMETHODCALLTYPE *AddRef )(
  705. ISQLServerErrorInfo * This);
  706. ULONG ( STDMETHODCALLTYPE *Release )(
  707. ISQLServerErrorInfo * This);
  708. HRESULT ( STDMETHODCALLTYPE *GetErrorInfo )(
  709. ISQLServerErrorInfo * This,
  710. /* [out] */ SSERRORINFO **ppErrorInfo,
  711. /* [annotation][out] */
  712. __deref_out OLECHAR **ppStringsBuffer);
  713. END_INTERFACE
  714. } ISQLServerErrorInfoVtbl;
  715. interface ISQLServerErrorInfo
  716. {
  717. CONST_VTBL struct ISQLServerErrorInfoVtbl *lpVtbl;
  718. };
  719. #ifdef COBJMACROS
  720. #define ISQLServerErrorInfo_QueryInterface(This,riid,ppvObject) \
  721. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  722. #define ISQLServerErrorInfo_AddRef(This) \
  723. ( (This)->lpVtbl -> AddRef(This) )
  724. #define ISQLServerErrorInfo_Release(This) \
  725. ( (This)->lpVtbl -> Release(This) )
  726. #define ISQLServerErrorInfo_GetErrorInfo(This,ppErrorInfo,ppStringsBuffer) \
  727. ( (This)->lpVtbl -> GetErrorInfo(This,ppErrorInfo,ppStringsBuffer) )
  728. #endif /* COBJMACROS */
  729. #endif /* C style interface */
  730. #endif /* __ISQLServerErrorInfo_INTERFACE_DEFINED__ */
  731. #ifndef __IRowsetFastLoad_INTERFACE_DEFINED__
  732. #define __IRowsetFastLoad_INTERFACE_DEFINED__
  733. /* interface IRowsetFastLoad */
  734. /* [unique][uuid][object][local] */
  735. EXTERN_C const IID IID_IRowsetFastLoad;
  736. #if defined(__cplusplus) && !defined(CINTERFACE)
  737. MIDL_INTERFACE("5CF4CA13-EF21-11d0-97E7-00C04FC2AD98")
  738. IRowsetFastLoad : public IUnknown
  739. {
  740. public:
  741. virtual HRESULT STDMETHODCALLTYPE InsertRow(
  742. /* [in] */ HACCESSOR hAccessor,
  743. /* [in] */ void *pData) = 0;
  744. virtual HRESULT STDMETHODCALLTYPE Commit(
  745. /* [in] */ BOOL fDone) = 0;
  746. };
  747. #else /* C style interface */
  748. typedef struct IRowsetFastLoadVtbl
  749. {
  750. BEGIN_INTERFACE
  751. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  752. IRowsetFastLoad * This,
  753. /* [in] */ REFIID riid,
  754. /* [annotation][iid_is][out] */
  755. __RPC__deref_out void **ppvObject);
  756. ULONG ( STDMETHODCALLTYPE *AddRef )(
  757. IRowsetFastLoad * This);
  758. ULONG ( STDMETHODCALLTYPE *Release )(
  759. IRowsetFastLoad * This);
  760. HRESULT ( STDMETHODCALLTYPE *InsertRow )(
  761. IRowsetFastLoad * This,
  762. /* [in] */ HACCESSOR hAccessor,
  763. /* [in] */ void *pData);
  764. HRESULT ( STDMETHODCALLTYPE *Commit )(
  765. IRowsetFastLoad * This,
  766. /* [in] */ BOOL fDone);
  767. END_INTERFACE
  768. } IRowsetFastLoadVtbl;
  769. interface IRowsetFastLoad
  770. {
  771. CONST_VTBL struct IRowsetFastLoadVtbl *lpVtbl;
  772. };
  773. #ifdef COBJMACROS
  774. #define IRowsetFastLoad_QueryInterface(This,riid,ppvObject) \
  775. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  776. #define IRowsetFastLoad_AddRef(This) \
  777. ( (This)->lpVtbl -> AddRef(This) )
  778. #define IRowsetFastLoad_Release(This) \
  779. ( (This)->lpVtbl -> Release(This) )
  780. #define IRowsetFastLoad_InsertRow(This,hAccessor,pData) \
  781. ( (This)->lpVtbl -> InsertRow(This,hAccessor,pData) )
  782. #define IRowsetFastLoad_Commit(This,fDone) \
  783. ( (This)->lpVtbl -> Commit(This,fDone) )
  784. #endif /* COBJMACROS */
  785. #endif /* C style interface */
  786. #endif /* __IRowsetFastLoad_INTERFACE_DEFINED__ */
  787. /* interface __MIDL_itf_sqlncli_0000_0004 */
  788. /* [local] */
  789. #include <pshpack8.h> // 8-byte structure packing
  790. typedef struct tagDBTIME2
  791. {
  792. USHORT hour;
  793. USHORT minute;
  794. USHORT second;
  795. ULONG fraction;
  796. } DBTIME2;
  797. typedef struct tagDBTIMESTAMPOFFSET
  798. {
  799. SHORT year;
  800. USHORT month;
  801. USHORT day;
  802. USHORT hour;
  803. USHORT minute;
  804. USHORT second;
  805. ULONG fraction;
  806. SHORT timezone_hour;
  807. SHORT timezone_minute;
  808. } DBTIMESTAMPOFFSET;
  809. #include <poppack.h> // restore original structure packing
  810. struct SSVARIANT
  811. {
  812. SSVARTYPE vt;
  813. DWORD dwReserved1;
  814. DWORD dwReserved2;
  815. union
  816. {
  817. BYTE bTinyIntVal;
  818. SHORT sShortIntVal;
  819. LONG lIntVal;
  820. LONGLONG llBigIntVal;
  821. FLOAT fltRealVal;
  822. DOUBLE dblFloatVal;
  823. CY cyMoneyVal;
  824. VARIANT_BOOL fBitVal;
  825. BYTE rgbGuidVal[ 16 ];
  826. DB_NUMERIC numNumericVal;
  827. DBDATE dDateVal;
  828. DBTIMESTAMP tsDateTimeVal;
  829. struct _Time2Val
  830. {
  831. DBTIME2 tTime2Val;
  832. BYTE bScale;
  833. } Time2Val;
  834. struct _DateTimeVal
  835. {
  836. DBTIMESTAMP tsDateTimeVal;
  837. BYTE bScale;
  838. } DateTimeVal;
  839. struct _DateTimeOffsetVal
  840. {
  841. DBTIMESTAMPOFFSET tsoDateTimeOffsetVal;
  842. BYTE bScale;
  843. } DateTimeOffsetVal;
  844. struct _NCharVal
  845. {
  846. SHORT sActualLength;
  847. SHORT sMaxLength;
  848. WCHAR *pwchNCharVal;
  849. BYTE rgbReserved[ 5 ];
  850. DWORD dwReserved;
  851. WCHAR *pwchReserved;
  852. } NCharVal;
  853. struct _CharVal
  854. {
  855. SHORT sActualLength;
  856. SHORT sMaxLength;
  857. CHAR *pchCharVal;
  858. BYTE rgbReserved[ 5 ];
  859. DWORD dwReserved;
  860. WCHAR *pwchReserved;
  861. } CharVal;
  862. struct _BinaryVal
  863. {
  864. SHORT sActualLength;
  865. SHORT sMaxLength;
  866. BYTE *prgbBinaryVal;
  867. DWORD dwReserved;
  868. } BinaryVal;
  869. struct _UnknownType
  870. {
  871. DWORD dwActualLength;
  872. BYTE rgMetadata[ 16 ];
  873. BYTE *pUnknownData;
  874. } UnknownType;
  875. struct _BLOBType
  876. {
  877. DBOBJECT dbobj;
  878. IUnknown *pUnk;
  879. } BLOBType;
  880. } ;
  881. } ;
  882. typedef DWORD LOCKMODE;
  883. enum LOCKMODEENUM
  884. { LOCKMODE_INVALID = 0,
  885. LOCKMODE_EXCLUSIVE = ( LOCKMODE_INVALID + 1 ) ,
  886. LOCKMODE_SHARED = ( LOCKMODE_EXCLUSIVE + 1 )
  887. } ;
  888. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0004_v0_0_c_ifspec;
  889. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0004_v0_0_s_ifspec;
  890. #ifndef __ISchemaLock_INTERFACE_DEFINED__
  891. #define __ISchemaLock_INTERFACE_DEFINED__
  892. /* interface ISchemaLock */
  893. /* [unique][uuid][object][local] */
  894. EXTERN_C const IID IID_ISchemaLock;
  895. #if defined(__cplusplus) && !defined(CINTERFACE)
  896. MIDL_INTERFACE("4C2389FB-2511-11d4-B258-00C04F7971CE")
  897. ISchemaLock : public IUnknown
  898. {
  899. public:
  900. virtual HRESULT STDMETHODCALLTYPE GetSchemaLock(
  901. /* [in] */ DBID *pTableID,
  902. /* [in] */ LOCKMODE lmMode,
  903. /* [out] */ HANDLE *phLockHandle,
  904. /* [out] */ ULONGLONG *pTableVersion) = 0;
  905. virtual HRESULT STDMETHODCALLTYPE ReleaseSchemaLock(
  906. /* [in] */ HANDLE hLockHandle) = 0;
  907. };
  908. #else /* C style interface */
  909. typedef struct ISchemaLockVtbl
  910. {
  911. BEGIN_INTERFACE
  912. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  913. ISchemaLock * This,
  914. /* [in] */ REFIID riid,
  915. /* [annotation][iid_is][out] */
  916. __RPC__deref_out void **ppvObject);
  917. ULONG ( STDMETHODCALLTYPE *AddRef )(
  918. ISchemaLock * This);
  919. ULONG ( STDMETHODCALLTYPE *Release )(
  920. ISchemaLock * This);
  921. HRESULT ( STDMETHODCALLTYPE *GetSchemaLock )(
  922. ISchemaLock * This,
  923. /* [in] */ DBID *pTableID,
  924. /* [in] */ LOCKMODE lmMode,
  925. /* [out] */ HANDLE *phLockHandle,
  926. /* [out] */ ULONGLONG *pTableVersion);
  927. HRESULT ( STDMETHODCALLTYPE *ReleaseSchemaLock )(
  928. ISchemaLock * This,
  929. /* [in] */ HANDLE hLockHandle);
  930. END_INTERFACE
  931. } ISchemaLockVtbl;
  932. interface ISchemaLock
  933. {
  934. CONST_VTBL struct ISchemaLockVtbl *lpVtbl;
  935. };
  936. #ifdef COBJMACROS
  937. #define ISchemaLock_QueryInterface(This,riid,ppvObject) \
  938. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  939. #define ISchemaLock_AddRef(This) \
  940. ( (This)->lpVtbl -> AddRef(This) )
  941. #define ISchemaLock_Release(This) \
  942. ( (This)->lpVtbl -> Release(This) )
  943. #define ISchemaLock_GetSchemaLock(This,pTableID,lmMode,phLockHandle,pTableVersion) \
  944. ( (This)->lpVtbl -> GetSchemaLock(This,pTableID,lmMode,phLockHandle,pTableVersion) )
  945. #define ISchemaLock_ReleaseSchemaLock(This,hLockHandle) \
  946. ( (This)->lpVtbl -> ReleaseSchemaLock(This,hLockHandle) )
  947. #endif /* COBJMACROS */
  948. #endif /* C style interface */
  949. #endif /* __ISchemaLock_INTERFACE_DEFINED__ */
  950. #ifndef __IBCPSession_INTERFACE_DEFINED__
  951. #define __IBCPSession_INTERFACE_DEFINED__
  952. /* interface IBCPSession */
  953. /* [unique][uuid][object][local] */
  954. EXTERN_C const IID IID_IBCPSession;
  955. #if defined(__cplusplus) && !defined(CINTERFACE)
  956. MIDL_INTERFACE("88352D80-42D1-42f0-A170-AB0F8B45B939")
  957. IBCPSession : public IUnknown
  958. {
  959. public:
  960. virtual HRESULT STDMETHODCALLTYPE BCPColFmt(
  961. /* [in] */ DBORDINAL idxUserDataCol,
  962. /* [in] */ int eUserDataType,
  963. /* [in] */ int cbIndicator,
  964. /* [in] */ int cbUserData,
  965. /* [size_is][in] */ BYTE *pbUserDataTerm,
  966. /* [in] */ int cbUserDataTerm,
  967. /* [in] */ DBORDINAL idxServerCol) = 0;
  968. virtual HRESULT STDMETHODCALLTYPE BCPColumns(
  969. /* [in] */ DBCOUNTITEM nColumns) = 0;
  970. virtual HRESULT STDMETHODCALLTYPE BCPControl(
  971. /* [in] */ int eOption,
  972. /* [in] */ void *iValue) = 0;
  973. virtual HRESULT STDMETHODCALLTYPE BCPDone( void) = 0;
  974. virtual HRESULT STDMETHODCALLTYPE BCPExec(
  975. /* [out] */ DBROWCOUNT *pRowsCopied) = 0;
  976. virtual HRESULT STDMETHODCALLTYPE BCPInit(
  977. /* [string][in] */ const wchar_t *pwszTable,
  978. /* [string][in] */ const wchar_t *pwszDataFile,
  979. /* [string][in] */ const wchar_t *pwszErrorFile,
  980. /* [in] */ int eDirection) = 0;
  981. virtual HRESULT STDMETHODCALLTYPE BCPReadFmt(
  982. /* [string][in] */ const wchar_t *pwszFormatFile) = 0;
  983. virtual HRESULT STDMETHODCALLTYPE BCPWriteFmt(
  984. /* [string][in] */ const wchar_t *pwszFormatFile) = 0;
  985. };
  986. #else /* C style interface */
  987. typedef struct IBCPSessionVtbl
  988. {
  989. BEGIN_INTERFACE
  990. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  991. IBCPSession * This,
  992. /* [in] */ REFIID riid,
  993. /* [annotation][iid_is][out] */
  994. __RPC__deref_out void **ppvObject);
  995. ULONG ( STDMETHODCALLTYPE *AddRef )(
  996. IBCPSession * This);
  997. ULONG ( STDMETHODCALLTYPE *Release )(
  998. IBCPSession * This);
  999. HRESULT ( STDMETHODCALLTYPE *BCPColFmt )(
  1000. IBCPSession * This,
  1001. /* [in] */ DBORDINAL idxUserDataCol,
  1002. /* [in] */ int eUserDataType,
  1003. /* [in] */ int cbIndicator,
  1004. /* [in] */ int cbUserData,
  1005. /* [size_is][in] */ BYTE *pbUserDataTerm,
  1006. /* [in] */ int cbUserDataTerm,
  1007. /* [in] */ DBORDINAL idxServerCol);
  1008. HRESULT ( STDMETHODCALLTYPE *BCPColumns )(
  1009. IBCPSession * This,
  1010. /* [in] */ DBCOUNTITEM nColumns);
  1011. HRESULT ( STDMETHODCALLTYPE *BCPControl )(
  1012. IBCPSession * This,
  1013. /* [in] */ int eOption,
  1014. /* [in] */ void *iValue);
  1015. HRESULT ( STDMETHODCALLTYPE *BCPDone )(
  1016. IBCPSession * This);
  1017. HRESULT ( STDMETHODCALLTYPE *BCPExec )(
  1018. IBCPSession * This,
  1019. /* [out] */ DBROWCOUNT *pRowsCopied);
  1020. HRESULT ( STDMETHODCALLTYPE *BCPInit )(
  1021. IBCPSession * This,
  1022. /* [string][in] */ const wchar_t *pwszTable,
  1023. /* [string][in] */ const wchar_t *pwszDataFile,
  1024. /* [string][in] */ const wchar_t *pwszErrorFile,
  1025. /* [in] */ int eDirection);
  1026. HRESULT ( STDMETHODCALLTYPE *BCPReadFmt )(
  1027. IBCPSession * This,
  1028. /* [string][in] */ const wchar_t *pwszFormatFile);
  1029. HRESULT ( STDMETHODCALLTYPE *BCPWriteFmt )(
  1030. IBCPSession * This,
  1031. /* [string][in] */ const wchar_t *pwszFormatFile);
  1032. END_INTERFACE
  1033. } IBCPSessionVtbl;
  1034. interface IBCPSession
  1035. {
  1036. CONST_VTBL struct IBCPSessionVtbl *lpVtbl;
  1037. };
  1038. #ifdef COBJMACROS
  1039. #define IBCPSession_QueryInterface(This,riid,ppvObject) \
  1040. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  1041. #define IBCPSession_AddRef(This) \
  1042. ( (This)->lpVtbl -> AddRef(This) )
  1043. #define IBCPSession_Release(This) \
  1044. ( (This)->lpVtbl -> Release(This) )
  1045. #define IBCPSession_BCPColFmt(This,idxUserDataCol,eUserDataType,cbIndicator,cbUserData,pbUserDataTerm,cbUserDataTerm,idxServerCol) \
  1046. ( (This)->lpVtbl -> BCPColFmt(This,idxUserDataCol,eUserDataType,cbIndicator,cbUserData,pbUserDataTerm,cbUserDataTerm,idxServerCol) )
  1047. #define IBCPSession_BCPColumns(This,nColumns) \
  1048. ( (This)->lpVtbl -> BCPColumns(This,nColumns) )
  1049. #define IBCPSession_BCPControl(This,eOption,iValue) \
  1050. ( (This)->lpVtbl -> BCPControl(This,eOption,iValue) )
  1051. #define IBCPSession_BCPDone(This) \
  1052. ( (This)->lpVtbl -> BCPDone(This) )
  1053. #define IBCPSession_BCPExec(This,pRowsCopied) \
  1054. ( (This)->lpVtbl -> BCPExec(This,pRowsCopied) )
  1055. #define IBCPSession_BCPInit(This,pwszTable,pwszDataFile,pwszErrorFile,eDirection) \
  1056. ( (This)->lpVtbl -> BCPInit(This,pwszTable,pwszDataFile,pwszErrorFile,eDirection) )
  1057. #define IBCPSession_BCPReadFmt(This,pwszFormatFile) \
  1058. ( (This)->lpVtbl -> BCPReadFmt(This,pwszFormatFile) )
  1059. #define IBCPSession_BCPWriteFmt(This,pwszFormatFile) \
  1060. ( (This)->lpVtbl -> BCPWriteFmt(This,pwszFormatFile) )
  1061. #endif /* COBJMACROS */
  1062. #endif /* C style interface */
  1063. #endif /* __IBCPSession_INTERFACE_DEFINED__ */
  1064. #ifndef __IBCPSession2_INTERFACE_DEFINED__
  1065. #define __IBCPSession2_INTERFACE_DEFINED__
  1066. /* interface IBCPSession2 */
  1067. /* [unique][uuid][object][local] */
  1068. EXTERN_C const IID IID_IBCPSession2;
  1069. #if defined(__cplusplus) && !defined(CINTERFACE)
  1070. MIDL_INTERFACE("AD79D3B6-59DD-46a3-BFC6-E62A65FF3523")
  1071. IBCPSession2 : public IBCPSession
  1072. {
  1073. public:
  1074. virtual HRESULT STDMETHODCALLTYPE BCPSetBulkMode(
  1075. /* [in] */ int property,
  1076. /* [size_is][in] */ void *pField,
  1077. /* [in] */ int cbField,
  1078. /* [size_is][in] */ void *pRow,
  1079. /* [in] */ int cbRow) = 0;
  1080. };
  1081. #else /* C style interface */
  1082. typedef struct IBCPSession2Vtbl
  1083. {
  1084. BEGIN_INTERFACE
  1085. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  1086. IBCPSession2 * This,
  1087. /* [in] */ REFIID riid,
  1088. /* [annotation][iid_is][out] */
  1089. __RPC__deref_out void **ppvObject);
  1090. ULONG ( STDMETHODCALLTYPE *AddRef )(
  1091. IBCPSession2 * This);
  1092. ULONG ( STDMETHODCALLTYPE *Release )(
  1093. IBCPSession2 * This);
  1094. HRESULT ( STDMETHODCALLTYPE *BCPColFmt )(
  1095. IBCPSession2 * This,
  1096. /* [in] */ DBORDINAL idxUserDataCol,
  1097. /* [in] */ int eUserDataType,
  1098. /* [in] */ int cbIndicator,
  1099. /* [in] */ int cbUserData,
  1100. /* [size_is][in] */ BYTE *pbUserDataTerm,
  1101. /* [in] */ int cbUserDataTerm,
  1102. /* [in] */ DBORDINAL idxServerCol);
  1103. HRESULT ( STDMETHODCALLTYPE *BCPColumns )(
  1104. IBCPSession2 * This,
  1105. /* [in] */ DBCOUNTITEM nColumns);
  1106. HRESULT ( STDMETHODCALLTYPE *BCPControl )(
  1107. IBCPSession2 * This,
  1108. /* [in] */ int eOption,
  1109. /* [in] */ void *iValue);
  1110. HRESULT ( STDMETHODCALLTYPE *BCPDone )(
  1111. IBCPSession2 * This);
  1112. HRESULT ( STDMETHODCALLTYPE *BCPExec )(
  1113. IBCPSession2 * This,
  1114. /* [out] */ DBROWCOUNT *pRowsCopied);
  1115. HRESULT ( STDMETHODCALLTYPE *BCPInit )(
  1116. IBCPSession2 * This,
  1117. /* [string][in] */ const wchar_t *pwszTable,
  1118. /* [string][in] */ const wchar_t *pwszDataFile,
  1119. /* [string][in] */ const wchar_t *pwszErrorFile,
  1120. /* [in] */ int eDirection);
  1121. HRESULT ( STDMETHODCALLTYPE *BCPReadFmt )(
  1122. IBCPSession2 * This,
  1123. /* [string][in] */ const wchar_t *pwszFormatFile);
  1124. HRESULT ( STDMETHODCALLTYPE *BCPWriteFmt )(
  1125. IBCPSession2 * This,
  1126. /* [string][in] */ const wchar_t *pwszFormatFile);
  1127. HRESULT ( STDMETHODCALLTYPE *BCPSetBulkMode )(
  1128. IBCPSession2 * This,
  1129. /* [in] */ int property,
  1130. /* [size_is][in] */ void *pField,
  1131. /* [in] */ int cbField,
  1132. /* [size_is][in] */ void *pRow,
  1133. /* [in] */ int cbRow);
  1134. END_INTERFACE
  1135. } IBCPSession2Vtbl;
  1136. interface IBCPSession2
  1137. {
  1138. CONST_VTBL struct IBCPSession2Vtbl *lpVtbl;
  1139. };
  1140. #ifdef COBJMACROS
  1141. #define IBCPSession2_QueryInterface(This,riid,ppvObject) \
  1142. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  1143. #define IBCPSession2_AddRef(This) \
  1144. ( (This)->lpVtbl -> AddRef(This) )
  1145. #define IBCPSession2_Release(This) \
  1146. ( (This)->lpVtbl -> Release(This) )
  1147. #define IBCPSession2_BCPColFmt(This,idxUserDataCol,eUserDataType,cbIndicator,cbUserData,pbUserDataTerm,cbUserDataTerm,idxServerCol) \
  1148. ( (This)->lpVtbl -> BCPColFmt(This,idxUserDataCol,eUserDataType,cbIndicator,cbUserData,pbUserDataTerm,cbUserDataTerm,idxServerCol) )
  1149. #define IBCPSession2_BCPColumns(This,nColumns) \
  1150. ( (This)->lpVtbl -> BCPColumns(This,nColumns) )
  1151. #define IBCPSession2_BCPControl(This,eOption,iValue) \
  1152. ( (This)->lpVtbl -> BCPControl(This,eOption,iValue) )
  1153. #define IBCPSession2_BCPDone(This) \
  1154. ( (This)->lpVtbl -> BCPDone(This) )
  1155. #define IBCPSession2_BCPExec(This,pRowsCopied) \
  1156. ( (This)->lpVtbl -> BCPExec(This,pRowsCopied) )
  1157. #define IBCPSession2_BCPInit(This,pwszTable,pwszDataFile,pwszErrorFile,eDirection) \
  1158. ( (This)->lpVtbl -> BCPInit(This,pwszTable,pwszDataFile,pwszErrorFile,eDirection) )
  1159. #define IBCPSession2_BCPReadFmt(This,pwszFormatFile) \
  1160. ( (This)->lpVtbl -> BCPReadFmt(This,pwszFormatFile) )
  1161. #define IBCPSession2_BCPWriteFmt(This,pwszFormatFile) \
  1162. ( (This)->lpVtbl -> BCPWriteFmt(This,pwszFormatFile) )
  1163. #define IBCPSession2_BCPSetBulkMode(This,property,pField,cbField,pRow,cbRow) \
  1164. ( (This)->lpVtbl -> BCPSetBulkMode(This,property,pField,cbField,pRow,cbRow) )
  1165. #endif /* COBJMACROS */
  1166. #endif /* C style interface */
  1167. #endif /* __IBCPSession2_INTERFACE_DEFINED__ */
  1168. /* interface __MIDL_itf_sqlncli_0000_0007 */
  1169. /* [local] */
  1170. #endif //_SQLOLEDB_H_
  1171. #define ISOLATIONLEVEL_SNAPSHOT ((ISOLATIONLEVEL)(0x01000000)) // Changes made in other transactions can not be seen.
  1172. #define DBPROPVAL_TI_SNAPSHOT 0x01000000L
  1173. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0007_v0_0_c_ifspec;
  1174. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0007_v0_0_s_ifspec;
  1175. #ifndef __ISSAbort_INTERFACE_DEFINED__
  1176. #define __ISSAbort_INTERFACE_DEFINED__
  1177. /* interface ISSAbort */
  1178. /* [unique][uuid][object][local] */
  1179. EXTERN_C const IID IID_ISSAbort;
  1180. #if defined(__cplusplus) && !defined(CINTERFACE)
  1181. MIDL_INTERFACE("5CF4CA15-EF21-11d0-97E7-00C04FC2AD98")
  1182. ISSAbort : public IUnknown
  1183. {
  1184. public:
  1185. virtual HRESULT STDMETHODCALLTYPE Abort( void) = 0;
  1186. };
  1187. #else /* C style interface */
  1188. typedef struct ISSAbortVtbl
  1189. {
  1190. BEGIN_INTERFACE
  1191. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  1192. ISSAbort * This,
  1193. /* [in] */ REFIID riid,
  1194. /* [annotation][iid_is][out] */
  1195. __RPC__deref_out void **ppvObject);
  1196. ULONG ( STDMETHODCALLTYPE *AddRef )(
  1197. ISSAbort * This);
  1198. ULONG ( STDMETHODCALLTYPE *Release )(
  1199. ISSAbort * This);
  1200. HRESULT ( STDMETHODCALLTYPE *Abort )(
  1201. ISSAbort * This);
  1202. END_INTERFACE
  1203. } ISSAbortVtbl;
  1204. interface ISSAbort
  1205. {
  1206. CONST_VTBL struct ISSAbortVtbl *lpVtbl;
  1207. };
  1208. #ifdef COBJMACROS
  1209. #define ISSAbort_QueryInterface(This,riid,ppvObject) \
  1210. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  1211. #define ISSAbort_AddRef(This) \
  1212. ( (This)->lpVtbl -> AddRef(This) )
  1213. #define ISSAbort_Release(This) \
  1214. ( (This)->lpVtbl -> Release(This) )
  1215. #define ISSAbort_Abort(This) \
  1216. ( (This)->lpVtbl -> Abort(This) )
  1217. #endif /* COBJMACROS */
  1218. #endif /* C style interface */
  1219. #endif /* __ISSAbort_INTERFACE_DEFINED__ */
  1220. /* interface __MIDL_itf_sqlncli_0000_0008 */
  1221. /* [local] */
  1222. enum DBBINDFLAGENUM90
  1223. { DBBINDFLAG_OBJECT = 0x2
  1224. } ;
  1225. enum SSACCESSORFLAGS
  1226. { SSACCESSOR_ROWDATA = 0x100
  1227. } ;
  1228. enum DBPROPFLAGSENUM90
  1229. { DBPROPFLAGS_PARAMETER = 0x10000
  1230. } ;
  1231. typedef struct tagSSPARAMPROPS
  1232. {
  1233. DBORDINAL iOrdinal;
  1234. ULONG cPropertySets;
  1235. DBPROPSET *rgPropertySets;
  1236. } SSPARAMPROPS;
  1237. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0008_v0_0_c_ifspec;
  1238. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0008_v0_0_s_ifspec;
  1239. #ifndef __ISSCommandWithParameters_INTERFACE_DEFINED__
  1240. #define __ISSCommandWithParameters_INTERFACE_DEFINED__
  1241. /* interface ISSCommandWithParameters */
  1242. /* [unique][uuid][object][local] */
  1243. EXTERN_C const IID IID_ISSCommandWithParameters;
  1244. #if defined(__cplusplus) && !defined(CINTERFACE)
  1245. MIDL_INTERFACE("eec30162-6087-467c-b995-7c523ce96561")
  1246. ISSCommandWithParameters : public ICommandWithParameters
  1247. {
  1248. public:
  1249. virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetParameterProperties(
  1250. /* [out][in] */ DB_UPARAMS *pcParams,
  1251. /* [size_is][size_is][out] */ SSPARAMPROPS **prgParamProperties) = 0;
  1252. virtual /* [local] */ HRESULT STDMETHODCALLTYPE SetParameterProperties(
  1253. /* [in] */ DB_UPARAMS cParams,
  1254. /* [size_is][unique][in] */ SSPARAMPROPS rgParamProperties[ ]) = 0;
  1255. };
  1256. #else /* C style interface */
  1257. typedef struct ISSCommandWithParametersVtbl
  1258. {
  1259. BEGIN_INTERFACE
  1260. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  1261. ISSCommandWithParameters * This,
  1262. /* [in] */ REFIID riid,
  1263. /* [annotation][iid_is][out] */
  1264. __RPC__deref_out void **ppvObject);
  1265. ULONG ( STDMETHODCALLTYPE *AddRef )(
  1266. ISSCommandWithParameters * This);
  1267. ULONG ( STDMETHODCALLTYPE *Release )(
  1268. ISSCommandWithParameters * This);
  1269. /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetParameterInfo )(
  1270. ISSCommandWithParameters * This,
  1271. /* [out][in] */ DB_UPARAMS *pcParams,
  1272. /* [size_is][size_is][out] */ DBPARAMINFO **prgParamInfo,
  1273. /* [out] */ OLECHAR **ppNamesBuffer);
  1274. /* [local] */ HRESULT ( STDMETHODCALLTYPE *MapParameterNames )(
  1275. ISSCommandWithParameters * This,
  1276. /* [in] */ DB_UPARAMS cParamNames,
  1277. /* [size_is][in] */ const OLECHAR *rgParamNames[ ],
  1278. /* [size_is][out] */ DB_LPARAMS rgParamOrdinals[ ]);
  1279. /* [local] */ HRESULT ( STDMETHODCALLTYPE *SetParameterInfo )(
  1280. ISSCommandWithParameters * This,
  1281. /* [in] */ DB_UPARAMS cParams,
  1282. /* [size_is][unique][in] */ const DB_UPARAMS rgParamOrdinals[ ],
  1283. /* [size_is][unique][in] */ const DBPARAMBINDINFO rgParamBindInfo[ ]);
  1284. /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetParameterProperties )(
  1285. ISSCommandWithParameters * This,
  1286. /* [out][in] */ DB_UPARAMS *pcParams,
  1287. /* [size_is][size_is][out] */ SSPARAMPROPS **prgParamProperties);
  1288. /* [local] */ HRESULT ( STDMETHODCALLTYPE *SetParameterProperties )(
  1289. ISSCommandWithParameters * This,
  1290. /* [in] */ DB_UPARAMS cParams,
  1291. /* [size_is][unique][in] */ SSPARAMPROPS rgParamProperties[ ]);
  1292. END_INTERFACE
  1293. } ISSCommandWithParametersVtbl;
  1294. interface ISSCommandWithParameters
  1295. {
  1296. CONST_VTBL struct ISSCommandWithParametersVtbl *lpVtbl;
  1297. };
  1298. #ifdef COBJMACROS
  1299. #define ISSCommandWithParameters_QueryInterface(This,riid,ppvObject) \
  1300. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  1301. #define ISSCommandWithParameters_AddRef(This) \
  1302. ( (This)->lpVtbl -> AddRef(This) )
  1303. #define ISSCommandWithParameters_Release(This) \
  1304. ( (This)->lpVtbl -> Release(This) )
  1305. #define ISSCommandWithParameters_GetParameterInfo(This,pcParams,prgParamInfo,ppNamesBuffer) \
  1306. ( (This)->lpVtbl -> GetParameterInfo(This,pcParams,prgParamInfo,ppNamesBuffer) )
  1307. #define ISSCommandWithParameters_MapParameterNames(This,cParamNames,rgParamNames,rgParamOrdinals) \
  1308. ( (This)->lpVtbl -> MapParameterNames(This,cParamNames,rgParamNames,rgParamOrdinals) )
  1309. #define ISSCommandWithParameters_SetParameterInfo(This,cParams,rgParamOrdinals,rgParamBindInfo) \
  1310. ( (This)->lpVtbl -> SetParameterInfo(This,cParams,rgParamOrdinals,rgParamBindInfo) )
  1311. #define ISSCommandWithParameters_GetParameterProperties(This,pcParams,prgParamProperties) \
  1312. ( (This)->lpVtbl -> GetParameterProperties(This,pcParams,prgParamProperties) )
  1313. #define ISSCommandWithParameters_SetParameterProperties(This,cParams,rgParamProperties) \
  1314. ( (This)->lpVtbl -> SetParameterProperties(This,cParams,rgParamProperties) )
  1315. #endif /* COBJMACROS */
  1316. #endif /* C style interface */
  1317. #endif /* __ISSCommandWithParameters_INTERFACE_DEFINED__ */
  1318. #ifndef __IDBAsynchStatus_INTERFACE_DEFINED__
  1319. #define __IDBAsynchStatus_INTERFACE_DEFINED__
  1320. /* interface IDBAsynchStatus */
  1321. /* [unique][uuid][object][local] */
  1322. EXTERN_C const IID IID_IDBAsynchStatus;
  1323. #if defined(__cplusplus) && !defined(CINTERFACE)
  1324. MIDL_INTERFACE("0c733a95-2a1c-11ce-ade5-00aa0044773d")
  1325. IDBAsynchStatus : public IUnknown
  1326. {
  1327. public:
  1328. virtual /* [local] */ HRESULT STDMETHODCALLTYPE Abort(
  1329. /* [in] */ HCHAPTER hChapter,
  1330. /* [in] */ DBASYNCHOP eOperation) = 0;
  1331. virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetStatus(
  1332. /* [in] */ HCHAPTER hChapter,
  1333. /* [in] */ DBASYNCHOP eOperation,
  1334. /* [out] */ DBCOUNTITEM *pulProgress,
  1335. /* [out] */ DBCOUNTITEM *pulProgressMax,
  1336. /* [out] */ DBASYNCHPHASE *peAsynchPhase,
  1337. /* [out] */ LPOLESTR *ppwszStatusText) = 0;
  1338. };
  1339. #else /* C style interface */
  1340. typedef struct IDBAsynchStatusVtbl
  1341. {
  1342. BEGIN_INTERFACE
  1343. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  1344. IDBAsynchStatus * This,
  1345. /* [in] */ REFIID riid,
  1346. /* [annotation][iid_is][out] */
  1347. __RPC__deref_out void **ppvObject);
  1348. ULONG ( STDMETHODCALLTYPE *AddRef )(
  1349. IDBAsynchStatus * This);
  1350. ULONG ( STDMETHODCALLTYPE *Release )(
  1351. IDBAsynchStatus * This);
  1352. /* [local] */ HRESULT ( STDMETHODCALLTYPE *Abort )(
  1353. IDBAsynchStatus * This,
  1354. /* [in] */ HCHAPTER hChapter,
  1355. /* [in] */ DBASYNCHOP eOperation);
  1356. /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetStatus )(
  1357. IDBAsynchStatus * This,
  1358. /* [in] */ HCHAPTER hChapter,
  1359. /* [in] */ DBASYNCHOP eOperation,
  1360. /* [out] */ DBCOUNTITEM *pulProgress,
  1361. /* [out] */ DBCOUNTITEM *pulProgressMax,
  1362. /* [out] */ DBASYNCHPHASE *peAsynchPhase,
  1363. /* [out] */ LPOLESTR *ppwszStatusText);
  1364. END_INTERFACE
  1365. } IDBAsynchStatusVtbl;
  1366. interface IDBAsynchStatus
  1367. {
  1368. CONST_VTBL struct IDBAsynchStatusVtbl *lpVtbl;
  1369. };
  1370. #ifdef COBJMACROS
  1371. #define IDBAsynchStatus_QueryInterface(This,riid,ppvObject) \
  1372. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  1373. #define IDBAsynchStatus_AddRef(This) \
  1374. ( (This)->lpVtbl -> AddRef(This) )
  1375. #define IDBAsynchStatus_Release(This) \
  1376. ( (This)->lpVtbl -> Release(This) )
  1377. #define IDBAsynchStatus_Abort(This,hChapter,eOperation) \
  1378. ( (This)->lpVtbl -> Abort(This,hChapter,eOperation) )
  1379. #define IDBAsynchStatus_GetStatus(This,hChapter,eOperation,pulProgress,pulProgressMax,peAsynchPhase,ppwszStatusText) \
  1380. ( (This)->lpVtbl -> GetStatus(This,hChapter,eOperation,pulProgress,pulProgressMax,peAsynchPhase,ppwszStatusText) )
  1381. #endif /* COBJMACROS */
  1382. #endif /* C style interface */
  1383. /* [call_as] */ HRESULT STDMETHODCALLTYPE IDBAsynchStatus_RemoteAbort_Proxy(
  1384. IDBAsynchStatus * This,
  1385. /* [in] */ HCHAPTER hChapter,
  1386. /* [in] */ DBASYNCHOP eOperation,
  1387. /* [out] */ IErrorInfo **ppErrorInfoRem);
  1388. void __RPC_STUB IDBAsynchStatus_RemoteAbort_Stub(
  1389. IRpcStubBuffer *This,
  1390. IRpcChannelBuffer *_pRpcChannelBuffer,
  1391. PRPC_MESSAGE _pRpcMessage,
  1392. DWORD *_pdwStubPhase);
  1393. /* [call_as] */ HRESULT STDMETHODCALLTYPE IDBAsynchStatus_RemoteGetStatus_Proxy(
  1394. IDBAsynchStatus * This,
  1395. /* [in] */ HCHAPTER hChapter,
  1396. /* [in] */ DBASYNCHOP eOperation,
  1397. /* [unique][out][in] */ DBCOUNTITEM *pulProgress,
  1398. /* [unique][out][in] */ DBCOUNTITEM *pulProgressMax,
  1399. /* [unique][out][in] */ DBASYNCHPHASE *peAsynchPhase,
  1400. /* [unique][out][in] */ LPOLESTR *ppwszStatusText,
  1401. /* [out] */ IErrorInfo **ppErrorInfoRem);
  1402. void __RPC_STUB IDBAsynchStatus_RemoteGetStatus_Stub(
  1403. IRpcStubBuffer *This,
  1404. IRpcChannelBuffer *_pRpcChannelBuffer,
  1405. PRPC_MESSAGE _pRpcMessage,
  1406. DWORD *_pdwStubPhase);
  1407. #endif /* __IDBAsynchStatus_INTERFACE_DEFINED__ */
  1408. #ifndef __ISSAsynchStatus_INTERFACE_DEFINED__
  1409. #define __ISSAsynchStatus_INTERFACE_DEFINED__
  1410. /* interface ISSAsynchStatus */
  1411. /* [unique][uuid][object][local] */
  1412. EXTERN_C const IID IID_ISSAsynchStatus;
  1413. #if defined(__cplusplus) && !defined(CINTERFACE)
  1414. MIDL_INTERFACE("1FF1F743-8BB0-4c00-ACC4-C10E43B08FC1")
  1415. ISSAsynchStatus : public IDBAsynchStatus
  1416. {
  1417. public:
  1418. virtual /* [local] */ HRESULT STDMETHODCALLTYPE WaitForAsynchCompletion(
  1419. /* [in] */ DWORD dwMillisecTimeOut) = 0;
  1420. };
  1421. #else /* C style interface */
  1422. typedef struct ISSAsynchStatusVtbl
  1423. {
  1424. BEGIN_INTERFACE
  1425. HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
  1426. ISSAsynchStatus * This,
  1427. /* [in] */ REFIID riid,
  1428. /* [annotation][iid_is][out] */
  1429. __RPC__deref_out void **ppvObject);
  1430. ULONG ( STDMETHODCALLTYPE *AddRef )(
  1431. ISSAsynchStatus * This);
  1432. ULONG ( STDMETHODCALLTYPE *Release )(
  1433. ISSAsynchStatus * This);
  1434. /* [local] */ HRESULT ( STDMETHODCALLTYPE *Abort )(
  1435. ISSAsynchStatus * This,
  1436. /* [in] */ HCHAPTER hChapter,
  1437. /* [in] */ DBASYNCHOP eOperation);
  1438. /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetStatus )(
  1439. ISSAsynchStatus * This,
  1440. /* [in] */ HCHAPTER hChapter,
  1441. /* [in] */ DBASYNCHOP eOperation,
  1442. /* [out] */ DBCOUNTITEM *pulProgress,
  1443. /* [out] */ DBCOUNTITEM *pulProgressMax,
  1444. /* [out] */ DBASYNCHPHASE *peAsynchPhase,
  1445. /* [out] */ LPOLESTR *ppwszStatusText);
  1446. /* [local] */ HRESULT ( STDMETHODCALLTYPE *WaitForAsynchCompletion )(
  1447. ISSAsynchStatus * This,
  1448. /* [in] */ DWORD dwMillisecTimeOut);
  1449. END_INTERFACE
  1450. } ISSAsynchStatusVtbl;
  1451. interface ISSAsynchStatus
  1452. {
  1453. CONST_VTBL struct ISSAsynchStatusVtbl *lpVtbl;
  1454. };
  1455. #ifdef COBJMACROS
  1456. #define ISSAsynchStatus_QueryInterface(This,riid,ppvObject) \
  1457. ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
  1458. #define ISSAsynchStatus_AddRef(This) \
  1459. ( (This)->lpVtbl -> AddRef(This) )
  1460. #define ISSAsynchStatus_Release(This) \
  1461. ( (This)->lpVtbl -> Release(This) )
  1462. #define ISSAsynchStatus_Abort(This,hChapter,eOperation) \
  1463. ( (This)->lpVtbl -> Abort(This,hChapter,eOperation) )
  1464. #define ISSAsynchStatus_GetStatus(This,hChapter,eOperation,pulProgress,pulProgressMax,peAsynchPhase,ppwszStatusText) \
  1465. ( (This)->lpVtbl -> GetStatus(This,hChapter,eOperation,pulProgress,pulProgressMax,peAsynchPhase,ppwszStatusText) )
  1466. #define ISSAsynchStatus_WaitForAsynchCompletion(This,dwMillisecTimeOut) \
  1467. ( (This)->lpVtbl -> WaitForAsynchCompletion(This,dwMillisecTimeOut) )
  1468. #endif /* COBJMACROS */
  1469. #endif /* C style interface */
  1470. #endif /* __ISSAsynchStatus_INTERFACE_DEFINED__ */
  1471. /* interface __MIDL_itf_sqlncli_0000_0011 */
  1472. /* [local] */
  1473. //----------------------------------------------------------------------------
  1474. // Values for STATUS bitmask for DBSCHEMA_TABLES & DBSCHEMA_TABLES_INFO
  1475. #define TABLE_HAS_UPDATE_INSTEAD_OF_TRIGGER 0x00000001 //table has IOT defined
  1476. #define TABLE_HAS_DELETE_INSTEAD_OF_TRIGGER 0x00000002 //table has IOT defined
  1477. #define TABLE_HAS_INSERT_INSTEAD_OF_TRIGGER 0x00000004 //table has IOT defined
  1478. #define TABLE_HAS_AFTER_UPDATE_TRIGGER 0x00000008 //table has update trigger
  1479. #define TABLE_HAS_AFTER_DELETE_TRIGGER 0x00000010 //table has delete trigger
  1480. #define TABLE_HAS_AFTER_INSERT_TRIGGER 0x00000020 //table has insert trigger
  1481. #define TABLE_HAS_CASCADE_UPDATE 0x00000040 //table has cascade update
  1482. #define TABLE_HAS_CASCADE_DELETE 0x00000080 //table has cascade delete
  1483. //----------------------------------------------------------------------------
  1484. // PropIds for DBPROP_INIT_GENERALTIMEOUT
  1485. #if (OLEDBVER >= 0x0210)
  1486. #define DBPROP_INIT_GENERALTIMEOUT 0x11cL
  1487. #endif
  1488. //----------------------------------------------------------------------------
  1489. // PropIds for DBPROPSET_SQLSERVERDATASOURCE
  1490. #define SSPROP_ENABLEFASTLOAD 2
  1491. #define SSPROP_ENABLEBULKCOPY 3
  1492. //----------------------------------------------------------------------------
  1493. // PropIds for DBPROPSET_SQLSERVERDATASOURCEINFO
  1494. #define SSPROP_UNICODELCID 2
  1495. #define SSPROP_UNICODECOMPARISONSTYLE 3
  1496. #define SSPROP_COLUMNLEVELCOLLATION 4
  1497. #define SSPROP_CHARACTERSET 5
  1498. #define SSPROP_SORTORDER 6
  1499. #define SSPROP_CURRENTCOLLATION 7
  1500. #define SSPROP_INTEGRATEDAUTHENTICATIONMETHOD 8
  1501. #define SSPROP_MUTUALLYAUTHENTICATED 9
  1502. //----------------------------------------------------------------------------
  1503. // PropIds for DBPROPSET_SQLSERVERDBINIT
  1504. #define SSPROP_INIT_CURRENTLANGUAGE 4
  1505. #define SSPROP_INIT_NETWORKADDRESS 5
  1506. #define SSPROP_INIT_NETWORKLIBRARY 6
  1507. #define SSPROP_INIT_USEPROCFORPREP 7
  1508. #define SSPROP_INIT_AUTOTRANSLATE 8
  1509. #define SSPROP_INIT_PACKETSIZE 9
  1510. #define SSPROP_INIT_APPNAME 10
  1511. #define SSPROP_INIT_WSID 11
  1512. #define SSPROP_INIT_FILENAME 12
  1513. #define SSPROP_INIT_ENCRYPT 13
  1514. #define SSPROP_AUTH_REPL_SERVER_NAME 14
  1515. #define SSPROP_INIT_TAGCOLUMNCOLLATION 15
  1516. #define SSPROP_INIT_MARSCONNECTION 16
  1517. #define SSPROP_INIT_FAILOVERPARTNER 18
  1518. #define SSPROP_AUTH_OLD_PASSWORD 19
  1519. #define SSPROP_INIT_DATATYPECOMPATIBILITY 20
  1520. #define SSPROP_INIT_TRUST_SERVER_CERTIFICATE 21
  1521. #define SSPROP_INIT_SERVERSPN 22
  1522. #define SSPROP_INIT_FAILOVERPARTNERSPN 23
  1523. #define SSPROP_INIT_APPLICATIONINTENT 24
  1524. //-----------------------------------------------------------------------------
  1525. // Values for SSPROP_INIT_USEPROCFORPREP
  1526. #define SSPROPVAL_USEPROCFORPREP_OFF 0
  1527. #define SSPROPVAL_USEPROCFORPREP_ON 1
  1528. #define SSPROPVAL_USEPROCFORPREP_ON_DROP 2
  1529. //-----------------------------------------------------------------------------
  1530. // Values for SSPROP_INIT_DATATYPECOMPATIBILITY
  1531. #define SSPROPVAL_DATATYPECOMPATIBILITY_SQL2000 80
  1532. #define SSPROPVAL_DATATYPECOMPATIBILITY_DEFAULT 0
  1533. //----------------------------------------------------------------------------
  1534. // PropIds for DBPROPSET_SQLSERVERSESSION
  1535. #define SSPROP_QUOTEDCATALOGNAMES 2
  1536. #define SSPROP_ALLOWNATIVEVARIANT 3
  1537. #define SSPROP_SQLXMLXPROGID 4
  1538. #define SSPROP_ASYNCH_BULKCOPY 5
  1539. //----------------------------------------------------------------------------
  1540. // PropIds for DBPROPSET_SQLSERVERROWSET
  1541. #define SSPROP_MAXBLOBLENGTH 8
  1542. #define SSPROP_FASTLOADOPTIONS 9
  1543. #define SSPROP_FASTLOADKEEPNULLS 10
  1544. #define SSPROP_FASTLOADKEEPIDENTITY 11
  1545. #define SSPROP_CURSORAUTOFETCH 12
  1546. #define SSPROP_DEFERPREPARE 13
  1547. #define SSPROP_IRowsetFastLoad 14
  1548. #define SSPROP_QP_NOTIFICATION_TIMEOUT 17
  1549. #define SSPROP_QP_NOTIFICATION_MSGTEXT 18
  1550. #define SSPROP_QP_NOTIFICATION_OPTIONS 19
  1551. #define SSPROP_NOCOUNT_STATUS 20
  1552. #define SSPROP_COMPUTE_ID 21
  1553. #define SSPROP_COLUMN_ID 22
  1554. #define SSPROP_COMPUTE_BYLIST 23
  1555. #define SSPROP_ISSAsynchStatus 24
  1556. //-----------------------------------------------------------------------------
  1557. // Values for SSPROP_QP_NOTIFICATION_TIMEOUT
  1558. #define SSPROPVAL_DEFAULT_NOTIFICATION_TIMEOUT 432000 /* in sec */
  1559. #define SSPROPVAL_MAX_NOTIFICATION_TIMEOUT 0x7FFFFFFF /* in sec */
  1560. #define MAX_NOTIFICATION_LEN 2000 /* NVARCHAR [2000] for both ID & DELIVERY_QUEUE */
  1561. //----------------------------------------------------------------------------
  1562. // PropIds for DBPROPSET_SQLSERVERCOLUMN
  1563. #define SSPROP_COL_COLLATIONNAME 14
  1564. #define SSPROP_COL_UDT_CATALOGNAME 31
  1565. #define SSPROP_COL_UDT_SCHEMANAME 32
  1566. #define SSPROP_COL_UDT_NAME 33
  1567. #define SSPROP_COL_XML_SCHEMACOLLECTION_CATALOGNAME 34
  1568. #define SSPROP_COL_XML_SCHEMACOLLECTION_SCHEMANAME 35
  1569. #define SSPROP_COL_XML_SCHEMACOLLECTIONNAME 36
  1570. #define SSPROP_COL_COMPUTED 37
  1571. //----------------------------------------------------------------------------
  1572. // PropIds for DBPROPSET_SQLSERVERSTREAM
  1573. #define SSPROP_STREAM_XMLROOT 19
  1574. //----------------------------------------------------------------------------
  1575. // PropIds for DBPROPSET_SQLSERVERPARAMETER
  1576. #define SSPROP_PARAM_XML_SCHEMACOLLECTION_CATALOGNAME 24
  1577. #define SSPROP_PARAM_XML_SCHEMACOLLECTION_SCHEMANAME 25
  1578. #define SSPROP_PARAM_XML_SCHEMACOLLECTIONNAME 26
  1579. #define SSPROP_PARAM_UDT_CATALOGNAME 27
  1580. #define SSPROP_PARAM_UDT_SCHEMANAME 28
  1581. #define SSPROP_PARAM_UDT_NAME 29
  1582. #define SSPROP_PARAM_TYPE_CATALOGNAME 38
  1583. #define SSPROP_PARAM_TYPE_SCHEMANAME 39
  1584. #define SSPROP_PARAM_TYPE_TYPENAME 40
  1585. #define SSPROP_PARAM_TABLE_DEFAULT_COLUMNS 41
  1586. #define SSPROP_PARAM_TABLE_COLUMN_SORT_ORDER 42
  1587. //----------------------------------------------------------------------------
  1588. // PropIds for DBPROPSET_SQLSERVERINDEX
  1589. #define SSPROP_INDEX_XML 1
  1590. //-----------------------------------------------------------------------------
  1591. //
  1592. #define BCP_TYPE_DEFAULT 0x00
  1593. #define BCP_TYPE_SQLTEXT 0x23
  1594. #define BCP_TYPE_SQLVARBINARY 0x25
  1595. #define BCP_TYPE_SQLINTN 0x26
  1596. #define BCP_TYPE_SQLVARCHAR 0x27
  1597. #define BCP_TYPE_SQLBINARY 0x2d
  1598. #define BCP_TYPE_SQLIMAGE 0x22
  1599. #define BCP_TYPE_SQLCHARACTER 0x2f
  1600. #define BCP_TYPE_SQLINT1 0x30
  1601. #define BCP_TYPE_SQLBIT 0x32
  1602. #define BCP_TYPE_SQLINT2 0x34
  1603. #define BCP_TYPE_SQLINT4 0x38
  1604. #define BCP_TYPE_SQLMONEY 0x3c
  1605. #define BCP_TYPE_SQLDATETIME 0x3d
  1606. #define BCP_TYPE_SQLFLT8 0x3e
  1607. #define BCP_TYPE_SQLFLTN 0x6d
  1608. #define BCP_TYPE_SQLMONEYN 0x6e
  1609. #define BCP_TYPE_SQLDATETIMN 0x6f
  1610. #define BCP_TYPE_SQLFLT4 0x3b
  1611. #define BCP_TYPE_SQLMONEY4 0x7a
  1612. #define BCP_TYPE_SQLDATETIM4 0x3a
  1613. #define BCP_TYPE_SQLDECIMAL 0x6a
  1614. #define BCP_TYPE_SQLNUMERIC 0x6c
  1615. #define BCP_TYPE_SQLUNIQUEID 0x24
  1616. #define BCP_TYPE_SQLBIGCHAR 0xaf
  1617. #define BCP_TYPE_SQLBIGVARCHAR 0xa7
  1618. #define BCP_TYPE_SQLBIGBINARY 0xad
  1619. #define BCP_TYPE_SQLBIGVARBINARY 0xa5
  1620. #define BCP_TYPE_SQLBITN 0x68
  1621. #define BCP_TYPE_SQLNCHAR 0xef
  1622. #define BCP_TYPE_SQLNVARCHAR 0xe7
  1623. #define BCP_TYPE_SQLNTEXT 0x63
  1624. #define BCP_TYPE_SQLDECIMALN 0x6a
  1625. #define BCP_TYPE_SQLNUMERICN 0x6c
  1626. #define BCP_TYPE_SQLINT8 0x7f
  1627. #define BCP_TYPE_SQLVARIANT 0x62
  1628. #define BCP_TYPE_SQLUDT 0xf0
  1629. #define BCP_TYPE_SQLXML 0xf1
  1630. #define BCP_TYPE_SQLDATE 0x28
  1631. #define BCP_TYPE_SQLTIME 0x29
  1632. #define BCP_TYPE_SQLDATETIME2 0x2a
  1633. #define BCP_TYPE_SQLDATETIMEOFFSET 0x2b
  1634. #define BCP_DIRECTION_IN 1
  1635. #define BCP_DIRECTION_OUT 2
  1636. #define BCP_OPTION_MAXERRS 1
  1637. #define BCP_OPTION_FIRST 2
  1638. #define BCP_OPTION_LAST 3
  1639. #define BCP_OPTION_BATCH 4
  1640. #define BCP_OPTION_KEEPNULLS 5
  1641. #define BCP_OPTION_ABORT 6
  1642. #define BCP_OPTION_KEEPIDENTITY 8
  1643. #define BCP_OPTION_HINTSA 10
  1644. #define BCP_OPTION_HINTSW 11
  1645. #define BCP_OPTION_FILECP 12
  1646. #define BCP_OPTION_UNICODEFILE 13
  1647. #define BCP_OPTION_TEXTFILE 14
  1648. #define BCP_OPTION_FILEFMT 15
  1649. #define BCP_OPTION_FMTXML 16
  1650. #define BCP_OPTION_FIRSTEX 17
  1651. #define BCP_OPTION_LASTEX 18
  1652. #define BCP_OPTION_ROWCOUNT 19
  1653. #define BCP_OPTION_DELAYREADFMT 20
  1654. #define BCP_OUT_CHARACTER_MODE 0x01
  1655. #define BCP_OUT_WIDE_CHARACTER_MODE 0x02
  1656. #define BCP_OUT_NATIVE_TEXT_MODE 0x03
  1657. #define BCP_OUT_NATIVE_MODE 0x04
  1658. #define BCP_FILECP_ACP 0
  1659. #define BCP_FILECP_OEMCP 1
  1660. #define BCP_FILECP_RAW (-1)
  1661. #ifdef UNICODE
  1662. #define BCP_OPTION_HINTS BCP_OPTION_HINTSW
  1663. #else
  1664. #define BCP_OPTION_HINTS BCP_OPTION_HINTSA
  1665. #endif
  1666. #define BCP_PREFIX_DEFAULT (-10)
  1667. #define BCP_LENGTH_NULL (-1)
  1668. #define BCP_LENGTH_VARIABLE (-10)
  1669. //
  1670. //-----------------------------------------------------------------------------
  1671. //----------------------------------------------------------------------------
  1672. // Provider-specific Class Ids
  1673. //
  1674. #if SQLNCLI_VER >= 1100
  1675. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI11 = {0x397C2819L,0x8272,0x4532,{0xAD,0x3A,0xFB,0x5E,0x43,0xBE,0xAA,0x39}};
  1676. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI11_ERROR = {0xCA99D701L,0xE6E7,0x4db4,{0xA5,0xCC,0x81,0x54,0x1C,0x75,0x18,0x8A}};
  1677. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI11_ENUMERATOR = {0x8F612DD2L,0x7E28,0x424f,{0xA2,0xFD,0xC2,0xEE,0xCC,0x31,0x4A,0xA2}};
  1678. #endif
  1679. #if SQLNCLI_VER >= 1000
  1680. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI10 = {0x8F4A6B68L,0x4F36,0x4e3c,{0xBE,0x81,0xBC,0x7C,0xA4,0xE9,0xC4,0x5C}};
  1681. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI10_ERROR = {0x53F9C3BCL,0x275F,0x4FA5,{0xB3,0xE6,0x25,0xED,0xCD,0x51,0x20,0x23}};
  1682. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI10_ENUMERATOR = {0x91E4F2A5L,0x1B07,0x45f6,{0x86,0xBF,0x92,0x03,0xC7,0xC7,0x2B,0xE3}};
  1683. #endif
  1684. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI = {0x85ecafccL,0xbdd9,0x4b03,{0x97,0xa8,0xfa,0x65,0xcb,0xe3,0x85,0x9b}};
  1685. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI_ERROR = {0xe8bc0a7aL,0xea71,0x4263,{0x8c,0xda,0x94,0xf3,0x88,0xb8,0xed,0x10}};
  1686. extern const GUID OLEDBDECLSPEC CLSID_SQLNCLI_ENUMERATOR = {0x4898ad37L,0xfe05,0x42df,{0x92,0xf9,0xe8,0x57,0xdd,0xfe,0xe7,0x30}};
  1687. extern const GUID OLEDBDECLSPEC CLSID_ROWSET_TVP = {0xc7ef28d5L,0x7bee,0x443f,{0x86,0xda,0xe3,0x98,0x4f,0xcd,0x4d,0xf9}};
  1688. //----------------------------------------------------------------------------
  1689. // Provider-specific Interface Ids
  1690. //
  1691. #ifndef _SQLOLEDB_H_
  1692. extern const GUID OLEDBDECLSPEC IID_ISQLServerErrorInfo = {0x5cf4ca12,0xef21,0x11d0,{0x97,0xe7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1693. extern const GUID OLEDBDECLSPEC IID_IRowsetFastLoad = {0x5cf4ca13,0xef21,0x11d0,{0x97,0xe7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1694. extern const GUID OLEDBDECLSPEC IID_IUMSInitialize = {0x5cf4ca14,0xef21,0x11d0,{0x97,0xe7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1695. extern const GUID OLEDBDECLSPEC IID_ISchemaLock = {0x4c2389fb,0x2511,0x11d4,{0xb2,0x58,0x0,0xc0,0x4f,0x79,0x71,0xce}};
  1696. extern const GUID OLEDBDECLSPEC IID_ISQLXMLHelper = {0xd22a7678L,0xf860,0x40cd,{0xa5,0x67,0x15,0x63,0xde,0xb4,0x6d,0x49}};
  1697. #endif //_SQLOLEDB_H_
  1698. extern const GUID OLEDBDECLSPEC IID_ISSAbort = {0x5cf4ca15,0xef21,0x11d0,{0x97,0xe7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1699. extern const GUID OLEDBDECLSPEC IID_IBCPSession = {0x88352D80,0x42D1,0x42f0,{0xA1,0x70,0xAB,0x0F,0x8B,0x45,0xB9,0x39}};
  1700. extern const GUID OLEDBDECLSPEC IID_IBCPSession2 = {0xad79d3b6,0x59dd,0x46a3,{0xbf,0xc6,0xe6,0x2a,0x65,0xff,0x35,0x23}};
  1701. extern const GUID OLEDBDECLSPEC IID_ISSCommandWithParameters = {0xeec30162,0x6087,0x467c,{0xb9,0x95,0x7c,0x52,0x3c,0xe9,0x65,0x61}};
  1702. extern const GUID OLEDBDECLSPEC IID_ISSAsynchStatus = {0x1FF1F743,0x8BB0, 0x4c00,{0xAC,0xC4,0xC1,0x0E,0x43,0xB0,0x8F,0xC1}};
  1703. //----------------------------------------------------------------------------
  1704. // Provider-specific schema rowsets
  1705. //
  1706. #ifndef _SQLOLEDB_H_
  1707. extern const GUID OLEDBDECLSPEC DBSCHEMA_LINKEDSERVERS = {0x9093caf4,0x2eac,0x11d1,{0x98,0x9,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1708. #endif //_SQLOLEDB_H_
  1709. extern const GUID OLEDBDECLSPEC DBSCHEMA_SQL_ASSEMBLIES = {0x7c1112c8, 0xc2d3, 0x4f6e, {0x94, 0x9a, 0x98, 0x3d, 0x38, 0xa5, 0x8f, 0x46}};
  1710. extern const GUID OLEDBDECLSPEC DBSCHEMA_SQL_ASSEMBLY_DEPENDENCIES = {0xcb0f837b, 0x974c, 0x41b8, {0x90, 0x9d, 0x64, 0x9c, 0xaf, 0x45, 0xad, 0x2f}};
  1711. extern const GUID OLEDBDECLSPEC DBSCHEMA_SQL_USER_TYPES = {0xf1198bd8, 0xa424, 0x4ea3, {0x8d, 0x4c, 0x60, 0x7e, 0xee, 0x2b, 0xab, 0x60}};
  1712. extern const GUID OLEDBDECLSPEC DBSCHEMA_XML_COLLECTIONS = {0x56bfad8c, 0x6e8f, 0x480d, {0x91, 0xde, 0x35, 0x16, 0xd9, 0x9a, 0x5d, 0x10}};
  1713. extern const GUID OLEDBDECLSPEC DBSCHEMA_SQL_TABLE_TYPES = {0x4e26cde7, 0xaaa4, 0x41ed, {0x93, 0xdd, 0x37, 0x6e, 0x6d, 0x40, 0x9c, 0x17}};
  1714. extern const GUID OLEDBDECLSPEC DBSCHEMA_SQL_TABLE_TYPE_PRIMARY_KEYS = {0x9738faea, 0x31e8, 0x4f63, {0xae, 0xd, 0x61, 0x33, 0x16, 0x41, 0x8c, 0xdd}};
  1715. extern const GUID OLEDBDECLSPEC DBSCHEMA_SQL_TABLE_TYPE_COLUMNS = {0xa663d94b, 0xddf7, 0x4a7f, {0xa5, 0x37, 0xd6, 0x1f, 0x12, 0x36, 0x5d, 0x7c}};
  1716. extern const GUID OLEDBDECLSPEC DBSCHEMA_COLUMNS_EXTENDED = {0x66462f01, 0x633a, 0x44d9, {0xb0, 0xd0, 0xfe, 0x66, 0xf2, 0x1a, 0x0d, 0x24}};
  1717. extern const GUID OLEDBDECLSPEC DBSCHEMA_SPARSE_COLUMN_SET = {0x31a4837c, 0xf9ff, 0x405f, {0x89, 0x82, 0x02, 0x19, 0xaa, 0xaa, 0x4a, 0x12}};
  1718. #ifndef CRESTRICTIONS_DBSCHEMA_LINKEDSERVERS
  1719. #define CRESTRICTIONS_DBSCHEMA_LINKEDSERVERS 1
  1720. #endif
  1721. #ifndef CRESTRICTIONS_DBSCHEMA_ASSEMBLIES
  1722. #define CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLIES 4
  1723. #endif
  1724. #ifndef CRESTRICTIONS_DBSCHEMA_ASSEMBLY_DEPENDENCIES
  1725. #define CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLY_DEPENDENCIES 4
  1726. #endif
  1727. #ifndef CRESTRICTIONS_DBSCHEMA_USER_TYPES
  1728. #define CRESTRICTIONS_DBSCHEMA_SQL_USER_TYPES 3
  1729. #endif
  1730. #ifndef CRESTRICTIONS_DBSCHEMA_XML_COLLECTIONS
  1731. #define CRESTRICTIONS_DBSCHEMA_XML_COLLECTIONS 4
  1732. #endif
  1733. #ifndef CRESTRICTIONS_DBSCHEMA_SQL_TABLE_TYPES
  1734. #define CRESTRICTIONS_DBSCHEMA_SQL_TABLE_TYPES 3
  1735. #endif
  1736. #ifndef CRESTRICTIONS_DBSCHEMA_SQL_TABLE_TYPE_PRIMARY_KEYS
  1737. #define CRESTRICTIONS_DBSCHEMA_SQL_TABLE_TYPE_PRIMARY_KEYS 3
  1738. #endif
  1739. #ifndef CRESTRICTIONS_DBSCHEMA_SQL_TABLE_TYPE_COLUMNS
  1740. #define CRESTRICTIONS_DBSCHEMA_SQL_TABLE_TYPE_COLUMNS 4
  1741. #endif
  1742. #ifndef CRESTRICTIONS_DBSCHEMA_COLUMNS_EXTENDED
  1743. #define CRESTRICTIONS_DBSCHEMA_COLUMNS_EXTENDED 4
  1744. #endif
  1745. #ifndef CRESTRICTIONS_DBSCHEMA_SPARSE_COLUMN_SET
  1746. #define CRESTRICTIONS_DBSCHEMA_SPARSE_COLUMN_SET 4
  1747. #endif
  1748. //----------------------------------------------------------------------------
  1749. // Provider-specific property sets
  1750. //
  1751. #ifndef _SQLOLEDB_H_
  1752. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERDATASOURCE = {0x28efaee4,0x2d2c,0x11d1,{0x98,0x7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1753. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERDATASOURCEINFO= {0xdf10cb94,0x35f6,0x11d2,{0x9c,0x54,0x0,0xc0,0x4f,0x79,0x71,0xd3}};
  1754. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERDBINIT = {0x5cf4ca10,0xef21,0x11d0,{0x97,0xe7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1755. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERROWSET = {0x5cf4ca11,0xef21,0x11d0,{0x97,0xe7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1756. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERSESSION = {0x28efaee5,0x2d2c,0x11d1,{0x98,0x7,0x0,0xc0,0x4f,0xc2,0xad,0x98}};
  1757. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERCOLUMN = {0x3b63fb5e,0x3fbb,0x11d3,{0x9f,0x29,0x0,0xc0,0x4f,0x8e,0xe9,0xdc}};
  1758. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERSTREAM = {0x9f79c073,0x8a6d,0x4bca,{0xa8,0xa8,0xc9,0xb7,0x9a,0x9b,0x96,0x2d}};
  1759. #endif //_SQLOLEDB_H_
  1760. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERPARAMETER = {0xfee09128,0xa67d,0x47ea,{0x8d,0x40,0x24,0xa1,0xd4,0x73,0x7e,0x8d}};
  1761. extern const GUID OLEDBDECLSPEC DBPROPSET_SQLSERVERINDEX = {0xE428B84E,0xA6B7,0x413a,{0x94,0x65,0x56,0x23,0x2E,0x0D,0x2B,0xEB}};
  1762. extern const GUID OLEDBDECLSPEC DBPROPSET_PARAMETERALL = {0x2cd2b7d8,0xe7c2,0x4f6c,{0x9b,0x30,0x75,0xe2,0x58,0x46,0x10,0x97}};
  1763. //----------------------------------------------------------------------------
  1764. // Provider-specific columns for IColumnsRowset
  1765. //
  1766. #define DBCOLUMN_SS_X_GUID {0x627bd890,0xed54,0x11d2,{0xb9,0x94,0x0,0xc0,0x4f,0x8c,0xa8,0x2c}}
  1767. //
  1768. #ifndef _SQLOLEDB_H_
  1769. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_COMPFLAGS = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)100};
  1770. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_SORTID = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)101};
  1771. extern const DBID OLEDBDECLSPEC DBCOLUMN_BASETABLEINSTANCE = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)102};
  1772. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_TDSCOLLATION = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)103};
  1773. #endif //_SQLOLEDB_H_
  1774. extern const DBID OLEDBDECLSPEC DBCOLUMN_BASESERVERNAME = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)104};
  1775. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_XML_SCHEMACOLLECTION_CATALOGNAME= {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)105};
  1776. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_XML_SCHEMACOLLECTION_SCHEMANAME = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)106};
  1777. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_XML_SCHEMACOLLECTIONNAME = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)107};
  1778. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_UDT_CATALOGNAME = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)108};
  1779. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_UDT_SCHEMANAME = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)109};
  1780. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_UDT_NAME = {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)110};
  1781. extern const DBID OLEDBDECLSPEC DBCOLUMN_SS_ASSEMBLY_TYPENAME= {DBCOLUMN_SS_X_GUID, DBKIND_GUID_PROPID, (LPOLESTR)111};
  1782. // OLEDB part of SQL Server Native Client header - end here!
  1783. #endif // defined(_SQLNCLI_OLEDB_) || !defined(_SQLNCLI_ODBC_)
  1784. // ODBC part of SQL Server Native Client header - begin here!
  1785. #if defined(_SQLNCLI_ODBC_) || !defined(_SQLNCLI_OLEDB_)
  1786. #ifdef ODBCVER
  1787. // max SQL Server identifier length
  1788. #define SQL_MAX_SQLSERVERNAME 128
  1789. // SQLSetConnectAttr driver specific defines.
  1790. // Microsoft has 1200 thru 1249 reserved for Microsoft SQL Server Native Client driver usage.
  1791. // Connection attributes
  1792. #define SQL_COPT_SS_BASE 1200
  1793. #define SQL_COPT_SS_REMOTE_PWD (SQL_COPT_SS_BASE+1) // dbrpwset SQLSetConnectOption only
  1794. #define SQL_COPT_SS_USE_PROC_FOR_PREP (SQL_COPT_SS_BASE+2) // Use create proc for SQLPrepare
  1795. #define SQL_COPT_SS_INTEGRATED_SECURITY (SQL_COPT_SS_BASE+3) // Force integrated security on login
  1796. #define SQL_COPT_SS_PRESERVE_CURSORS (SQL_COPT_SS_BASE+4) // Preserve server cursors after SQLTransact
  1797. #define SQL_COPT_SS_USER_DATA (SQL_COPT_SS_BASE+5) // dbgetuserdata/dbsetuserdata
  1798. #define SQL_COPT_SS_ENLIST_IN_DTC SQL_ATTR_ENLIST_IN_DTC // Enlist in a DTC transaction
  1799. #define SQL_COPT_SS_ENLIST_IN_XA SQL_ATTR_ENLIST_IN_XA // Enlist in a XA transaction
  1800. #define SQL_COPT_SS_FALLBACK_CONNECT (SQL_COPT_SS_BASE+10) // Enables FallBack connections
  1801. #define SQL_COPT_SS_PERF_DATA (SQL_COPT_SS_BASE+11) // Used to access SQL Server ODBC driver performance data
  1802. #define SQL_COPT_SS_PERF_DATA_LOG (SQL_COPT_SS_BASE+12) // Used to set the logfile name for the Performance data
  1803. #define SQL_COPT_SS_PERF_QUERY_INTERVAL (SQL_COPT_SS_BASE+13) // Used to set the query logging threshold in milliseconds.
  1804. #define SQL_COPT_SS_PERF_QUERY_LOG (SQL_COPT_SS_BASE+14) // Used to set the logfile name for saving queryies.
  1805. #define SQL_COPT_SS_PERF_QUERY (SQL_COPT_SS_BASE+15) // Used to start and stop query logging.
  1806. #define SQL_COPT_SS_PERF_DATA_LOG_NOW (SQL_COPT_SS_BASE+16) // Used to make a statistics log entry to disk.
  1807. #define SQL_COPT_SS_QUOTED_IDENT (SQL_COPT_SS_BASE+17) // Enable/Disable Quoted Identifiers
  1808. #define SQL_COPT_SS_ANSI_NPW (SQL_COPT_SS_BASE+18) // Enable/Disable ANSI NULL, Padding and Warnings
  1809. #define SQL_COPT_SS_BCP (SQL_COPT_SS_BASE+19) // Allow BCP usage on connection
  1810. #define SQL_COPT_SS_TRANSLATE (SQL_COPT_SS_BASE+20) // Perform code page translation
  1811. #define SQL_COPT_SS_ATTACHDBFILENAME (SQL_COPT_SS_BASE+21) // File name to be attached as a database
  1812. #define SQL_COPT_SS_CONCAT_NULL (SQL_COPT_SS_BASE+22) // Enable/Disable CONCAT_NULL_YIELDS_NULL
  1813. #define SQL_COPT_SS_ENCRYPT (SQL_COPT_SS_BASE+23) // Allow strong encryption for data
  1814. #define SQL_COPT_SS_MARS_ENABLED (SQL_COPT_SS_BASE+24) // Multiple active result set per connection
  1815. #define SQL_COPT_SS_FAILOVER_PARTNER (SQL_COPT_SS_BASE+25) // Failover partner server
  1816. #define SQL_COPT_SS_OLDPWD (SQL_COPT_SS_BASE+26) // Old Password, used when changing password during login
  1817. #define SQL_COPT_SS_TXN_ISOLATION (SQL_COPT_SS_BASE+27) // Used to set/get any driver-specific or ODBC-defined TXN iso level
  1818. #define SQL_COPT_SS_TRUST_SERVER_CERTIFICATE (SQL_COPT_SS_BASE+28) // Trust server certificate
  1819. #define SQL_COPT_SS_SERVER_SPN (SQL_COPT_SS_BASE+29) // Server SPN
  1820. #define SQL_COPT_SS_FAILOVER_PARTNER_SPN (SQL_COPT_SS_BASE+30) // Failover partner server SPN
  1821. #define SQL_COPT_SS_INTEGRATED_AUTHENTICATION_METHOD (SQL_COPT_SS_BASE+31) // The integrated authentication method used for the connection
  1822. #define SQL_COPT_SS_MUTUALLY_AUTHENTICATED (SQL_COPT_SS_BASE+32) // Used to decide if the connection is mutually authenticated
  1823. #define SQL_COPT_SS_CLIENT_CONNECTION_ID (SQL_COPT_SS_BASE+33) // Post connection attribute used to get the ConnectionID
  1824. #define SQL_COPT_SS_MAX_USED SQL_COPT_SS_CLIENT_CONNECTION_ID
  1825. // Define old names
  1826. #define SQL_REMOTE_PWD SQL_COPT_SS_REMOTE_PWD
  1827. #define SQL_USE_PROCEDURE_FOR_PREPARE SQL_COPT_SS_USE_PROC_FOR_PREP
  1828. #define SQL_INTEGRATED_SECURITY SQL_COPT_SS_INTEGRATED_SECURITY
  1829. #define SQL_PRESERVE_CURSORS SQL_COPT_SS_PRESERVE_CURSORS
  1830. // SQLSetStmtAttr SQL Server Native Client driver specific defines.
  1831. // Statement attributes
  1832. #define SQL_SOPT_SS_BASE 1225
  1833. #define SQL_SOPT_SS_TEXTPTR_LOGGING (SQL_SOPT_SS_BASE+0) // Text pointer logging
  1834. #define SQL_SOPT_SS_CURRENT_COMMAND (SQL_SOPT_SS_BASE+1) // dbcurcmd SQLGetStmtOption only
  1835. #define SQL_SOPT_SS_HIDDEN_COLUMNS (SQL_SOPT_SS_BASE+2) // Expose FOR BROWSE hidden columns
  1836. #define SQL_SOPT_SS_NOBROWSETABLE (SQL_SOPT_SS_BASE+3) // Set NOBROWSETABLE option
  1837. #define SQL_SOPT_SS_REGIONALIZE (SQL_SOPT_SS_BASE+4) // Regionalize output character conversions
  1838. #define SQL_SOPT_SS_CURSOR_OPTIONS (SQL_SOPT_SS_BASE+5) // Server cursor options
  1839. #define SQL_SOPT_SS_NOCOUNT_STATUS (SQL_SOPT_SS_BASE+6) // Real vs. Not Real row count indicator
  1840. #define SQL_SOPT_SS_DEFER_PREPARE (SQL_SOPT_SS_BASE+7) // Defer prepare until necessary
  1841. #define SQL_SOPT_SS_QUERYNOTIFICATION_TIMEOUT (SQL_SOPT_SS_BASE+8) // Notification timeout
  1842. #define SQL_SOPT_SS_QUERYNOTIFICATION_MSGTEXT (SQL_SOPT_SS_BASE+9) // Notification message text
  1843. #define SQL_SOPT_SS_QUERYNOTIFICATION_OPTIONS (SQL_SOPT_SS_BASE+10)// SQL service broker name
  1844. #define SQL_SOPT_SS_PARAM_FOCUS (SQL_SOPT_SS_BASE+11)// Direct subsequent calls to parameter related methods to set properties on constituent columns/parameters of container types
  1845. #define SQL_SOPT_SS_NAME_SCOPE (SQL_SOPT_SS_BASE+12)// Sets name scope for subsequent catalog function calls
  1846. #define SQL_SOPT_SS_MAX_USED SQL_SOPT_SS_NAME_SCOPE
  1847. // Define old names
  1848. #define SQL_TEXTPTR_LOGGING SQL_SOPT_SS_TEXTPTR_LOGGING
  1849. #define SQL_COPT_SS_BASE_EX 1240
  1850. #define SQL_COPT_SS_BROWSE_CONNECT (SQL_COPT_SS_BASE_EX+1) // Browse connect mode of operation
  1851. #define SQL_COPT_SS_BROWSE_SERVER (SQL_COPT_SS_BASE_EX+2) // Single Server browse request.
  1852. #define SQL_COPT_SS_WARN_ON_CP_ERROR (SQL_COPT_SS_BASE_EX+3) // Issues warning when data from the server had a loss during code page conversion.
  1853. #define SQL_COPT_SS_CONNECTION_DEAD (SQL_COPT_SS_BASE_EX+4) // dbdead SQLGetConnectOption only. It will try to ping the server. Expensive connection check
  1854. #define SQL_COPT_SS_BROWSE_CACHE_DATA (SQL_COPT_SS_BASE_EX+5) // Determines if we should cache browse info. Used when returned buffer is greater then ODBC limit (32K)
  1855. #define SQL_COPT_SS_RESET_CONNECTION (SQL_COPT_SS_BASE_EX+6) // When this option is set, we will perform connection reset on next packet
  1856. #define SQL_COPT_SS_APPLICATION_INTENT (SQL_COPT_SS_BASE_EX+7) // Application Intent
  1857. #define SQL_COPT_SS_MULTISUBNET_FAILOVER (SQL_COPT_SS_BASE_EX+8) // Multi-subnet Failover
  1858. #define SQL_COPT_SS_EX_MAX_USED SQL_COPT_SS_MULTISUBNET_FAILOVER
  1859. // SQLColAttributes driver specific defines.
  1860. // SQLSetDescField/SQLGetDescField driver specific defines.
  1861. // Microsoft has 1200 thru 1249 reserved for Microsoft SQL Server Native Client driver usage.
  1862. #define SQL_CA_SS_BASE 1200
  1863. #define SQL_CA_SS_COLUMN_SSTYPE (SQL_CA_SS_BASE+0) // dbcoltype/dbalttype
  1864. #define SQL_CA_SS_COLUMN_UTYPE (SQL_CA_SS_BASE+1) // dbcolutype/dbaltutype
  1865. #define SQL_CA_SS_NUM_ORDERS (SQL_CA_SS_BASE+2) // dbnumorders
  1866. #define SQL_CA_SS_COLUMN_ORDER (SQL_CA_SS_BASE+3) // dbordercol
  1867. #define SQL_CA_SS_COLUMN_VARYLEN (SQL_CA_SS_BASE+4) // dbvarylen
  1868. #define SQL_CA_SS_NUM_COMPUTES (SQL_CA_SS_BASE+5) // dbnumcompute
  1869. #define SQL_CA_SS_COMPUTE_ID (SQL_CA_SS_BASE+6) // dbnextrow status return
  1870. #define SQL_CA_SS_COMPUTE_BYLIST (SQL_CA_SS_BASE+7) // dbbylist
  1871. #define SQL_CA_SS_COLUMN_ID (SQL_CA_SS_BASE+8) // dbaltcolid
  1872. #define SQL_CA_SS_COLUMN_OP (SQL_CA_SS_BASE+9) // dbaltop
  1873. #define SQL_CA_SS_COLUMN_SIZE (SQL_CA_SS_BASE+10) // dbcollen
  1874. #define SQL_CA_SS_COLUMN_HIDDEN (SQL_CA_SS_BASE+11) // Column is hidden (FOR BROWSE)
  1875. #define SQL_CA_SS_COLUMN_KEY (SQL_CA_SS_BASE+12) // Column is key column (FOR BROWSE)
  1876. //#define SQL_DESC_BASE_COLUMN_NAME_OLD (SQL_CA_SS_BASE+13) // This is defined at another location.
  1877. #define SQL_CA_SS_COLUMN_COLLATION (SQL_CA_SS_BASE+14) // Column collation (only for chars)
  1878. #define SQL_CA_SS_VARIANT_TYPE (SQL_CA_SS_BASE+15)
  1879. #define SQL_CA_SS_VARIANT_SQL_TYPE (SQL_CA_SS_BASE+16)
  1880. #define SQL_CA_SS_VARIANT_SERVER_TYPE (SQL_CA_SS_BASE+17)
  1881. // XML, CLR UDT, and table valued parameter related metadata
  1882. #define SQL_CA_SS_UDT_CATALOG_NAME (SQL_CA_SS_BASE+18) // UDT catalog name
  1883. #define SQL_CA_SS_UDT_SCHEMA_NAME (SQL_CA_SS_BASE+19) // UDT schema name
  1884. #define SQL_CA_SS_UDT_TYPE_NAME (SQL_CA_SS_BASE+20) // UDT type name
  1885. #define SQL_CA_SS_UDT_ASSEMBLY_TYPE_NAME (SQL_CA_SS_BASE+21) // Qualified name of the assembly containing the UDT class
  1886. #define SQL_CA_SS_XML_SCHEMACOLLECTION_CATALOG_NAME (SQL_CA_SS_BASE+22) // Name of the catalog that contains XML Schema collection
  1887. #define SQL_CA_SS_XML_SCHEMACOLLECTION_SCHEMA_NAME (SQL_CA_SS_BASE+23) // Name of the schema that contains XML Schema collection
  1888. #define SQL_CA_SS_XML_SCHEMACOLLECTION_NAME (SQL_CA_SS_BASE+24) // Name of the XML Schema collection
  1889. #define SQL_CA_SS_CATALOG_NAME (SQL_CA_SS_BASE+25) // Catalog name
  1890. #define SQL_CA_SS_SCHEMA_NAME (SQL_CA_SS_BASE+26) // Schema name
  1891. #define SQL_CA_SS_TYPE_NAME (SQL_CA_SS_BASE+27) // Type name
  1892. // table valued parameter related metadata
  1893. #define SQL_CA_SS_COLUMN_COMPUTED (SQL_CA_SS_BASE+29) // column is computed
  1894. #define SQL_CA_SS_COLUMN_IN_UNIQUE_KEY (SQL_CA_SS_BASE+30) // column is part of a unique key
  1895. #define SQL_CA_SS_COLUMN_SORT_ORDER (SQL_CA_SS_BASE+31) // column sort order
  1896. #define SQL_CA_SS_COLUMN_SORT_ORDINAL (SQL_CA_SS_BASE+32) // column sort ordinal
  1897. #define SQL_CA_SS_COLUMN_HAS_DEFAULT_VALUE (SQL_CA_SS_BASE+33) // column has default value for all rows of the table valued parameter
  1898. // sparse column related metadata
  1899. #define SQL_CA_SS_IS_COLUMN_SET (SQL_CA_SS_BASE+34) // column is a column-set column for sparse columns
  1900. // Legacy datetime related metadata
  1901. #define SQL_CA_SS_SERVER_TYPE (SQL_CA_SS_BASE+35) // column type to send on the wire for datetime types
  1902. #define SQL_CA_SS_MAX_USED (SQL_CA_SS_BASE+36)
  1903. // Defines returned by SQL_ATTR_CURSOR_TYPE/SQL_CURSOR_TYPE
  1904. #define SQL_CURSOR_FAST_FORWARD_ONLY 8 // Only returned by SQLGetStmtAttr/Option
  1905. // Defines for use with SQL_COPT_SS_USE_PROC_FOR_PREP
  1906. #define SQL_UP_OFF 0L // Procedures won't be used for prepare
  1907. #define SQL_UP_ON 1L // Procedures will be used for prepare
  1908. #define SQL_UP_ON_DROP 2L // Temp procedures will be explicitly dropped
  1909. #define SQL_UP_DEFAULT SQL_UP_ON
  1910. // Defines for use with SQL_COPT_SS_INTEGRATED_SECURITY - Pre-Connect Option only
  1911. #define SQL_IS_OFF 0L // Integrated security isn't used
  1912. #define SQL_IS_ON 1L // Integrated security is used
  1913. #define SQL_IS_DEFAULT SQL_IS_OFF
  1914. // Defines for use with SQL_COPT_SS_PRESERVE_CURSORS
  1915. #define SQL_PC_OFF 0L // Cursors are closed on SQLTransact
  1916. #define SQL_PC_ON 1L // Cursors remain open on SQLTransact
  1917. #define SQL_PC_DEFAULT SQL_PC_OFF
  1918. // Defines for use with SQL_COPT_SS_USER_DATA
  1919. #define SQL_UD_NOTSET NULL // No user data pointer set
  1920. // Defines for use with SQL_COPT_SS_TRANSLATE
  1921. #define SQL_XL_OFF 0L // Code page translation is not performed
  1922. #define SQL_XL_ON 1L // Code page translation is performed
  1923. #define SQL_XL_DEFAULT SQL_XL_ON
  1924. // Defines for use with SQL_COPT_SS_FALLBACK_CONNECT - Pre-Connect Option only
  1925. #define SQL_FB_OFF 0L // FallBack connections are disabled
  1926. #define SQL_FB_ON 1L // FallBack connections are enabled
  1927. #define SQL_FB_DEFAULT SQL_FB_OFF
  1928. // Defines for use with SQL_COPT_SS_BCP - Pre-Connect Option only
  1929. #define SQL_BCP_OFF 0L // BCP is not allowed on connection
  1930. #define SQL_BCP_ON 1L // BCP is allowed on connection
  1931. #define SQL_BCP_DEFAULT SQL_BCP_OFF
  1932. // Defines for use with SQL_COPT_SS_QUOTED_IDENT
  1933. #define SQL_QI_OFF 0L // Quoted identifiers are enable
  1934. #define SQL_QI_ON 1L // Quoted identifiers are disabled
  1935. #define SQL_QI_DEFAULT SQL_QI_ON
  1936. // Defines for use with SQL_COPT_SS_ANSI_NPW - Pre-Connect Option only
  1937. #define SQL_AD_OFF 0L // ANSI NULLs, Padding and Warnings are enabled
  1938. #define SQL_AD_ON 1L // ANSI NULLs, Padding and Warnings are disabled
  1939. #define SQL_AD_DEFAULT SQL_AD_ON
  1940. // Defines for use with SQL_COPT_SS_CONCAT_NULL - Pre-Connect Option only
  1941. #define SQL_CN_OFF 0L // CONCAT_NULL_YIELDS_NULL is off
  1942. #define SQL_CN_ON 1L // CONCAT_NULL_YIELDS_NULL is on
  1943. #define SQL_CN_DEFAULT SQL_CN_ON
  1944. // Defines for use with SQL_SOPT_SS_TEXTPTR_LOGGING
  1945. #define SQL_TL_OFF 0L // No logging on text pointer ops
  1946. #define SQL_TL_ON 1L // Logging occurs on text pointer ops
  1947. #define SQL_TL_DEFAULT SQL_TL_ON
  1948. // Defines for use with SQL_SOPT_SS_HIDDEN_COLUMNS
  1949. #define SQL_HC_OFF 0L // FOR BROWSE columns are hidden
  1950. #define SQL_HC_ON 1L // FOR BROWSE columns are exposed
  1951. #define SQL_HC_DEFAULT SQL_HC_OFF
  1952. // Defines for use with SQL_SOPT_SS_NOBROWSETABLE
  1953. #define SQL_NB_OFF 0L // NO_BROWSETABLE is off
  1954. #define SQL_NB_ON 1L // NO_BROWSETABLE is on
  1955. #define SQL_NB_DEFAULT SQL_NB_OFF
  1956. // Defines for use with SQL_SOPT_SS_REGIONALIZE
  1957. #define SQL_RE_OFF 0L // No regionalization occurs on output character conversions
  1958. #define SQL_RE_ON 1L // Regionalization occurs on output character conversions
  1959. #define SQL_RE_DEFAULT SQL_RE_OFF
  1960. // Defines for use with SQL_SOPT_SS_CURSOR_OPTIONS
  1961. #define SQL_CO_OFF 0L // Clear all cursor options
  1962. #define SQL_CO_FFO 1L // Fast-forward cursor will be used
  1963. #define SQL_CO_AF 2L // Autofetch on cursor open
  1964. #define SQL_CO_FFO_AF (SQL_CO_FFO|SQL_CO_AF) // Fast-forward cursor with autofetch
  1965. #define SQL_CO_FIREHOSE_AF 4L // Auto fetch on fire-hose cursors
  1966. #define SQL_CO_DEFAULT SQL_CO_OFF
  1967. //SQL_SOPT_SS_NOCOUNT_STATUS
  1968. #define SQL_NC_OFF 0L
  1969. #define SQL_NC_ON 1L
  1970. //SQL_SOPT_SS_DEFER_PREPARE
  1971. #define SQL_DP_OFF 0L
  1972. #define SQL_DP_ON 1L
  1973. //SQL_SOPT_SS_NAME_SCOPE
  1974. #define SQL_SS_NAME_SCOPE_TABLE 0L
  1975. #define SQL_SS_NAME_SCOPE_TABLE_TYPE 1L
  1976. #define SQL_SS_NAME_SCOPE_EXTENDED 2L
  1977. #define SQL_SS_NAME_SCOPE_SPARSE_COLUMN_SET 3L
  1978. #define SQL_SS_NAME_SCOPE_DEFAULT SQL_SS_NAME_SCOPE_TABLE
  1979. //SQL_COPT_SS_ENCRYPT
  1980. #define SQL_EN_OFF 0L
  1981. #define SQL_EN_ON 1L
  1982. //SQL_COPT_SS_TRUST_SERVER_CERTIFICATE
  1983. #define SQL_TRUST_SERVER_CERTIFICATE_NO 0L
  1984. #define SQL_TRUST_SERVER_CERTIFICATE_YES 1L
  1985. //SQL_COPT_SS_BROWSE_CONNECT
  1986. #define SQL_MORE_INFO_NO 0L
  1987. #define SQL_MORE_INFO_YES 1L
  1988. //SQL_COPT_SS_BROWSE_CACHE_DATA
  1989. #define SQL_CACHE_DATA_NO 0L
  1990. #define SQL_CACHE_DATA_YES 1L
  1991. //SQL_COPT_SS_RESET_CONNECTION
  1992. #define SQL_RESET_YES 1L
  1993. //SQL_COPT_SS_WARN_ON_CP_ERROR
  1994. #define SQL_WARN_NO 0L
  1995. #define SQL_WARN_YES 1L
  1996. //SQL_COPT_SS_MARS_ENABLED
  1997. #define SQL_MARS_ENABLED_NO 0L
  1998. #define SQL_MARS_ENABLED_YES 1L
  1999. /* SQL_TXN_ISOLATION_OPTION bitmasks */
  2000. #define SQL_TXN_SS_SNAPSHOT 0x00000020L
  2001. // The following are defines for SQL_CA_SS_COLUMN_SORT_ORDER
  2002. #define SQL_SS_ORDER_UNSPECIFIED 0L
  2003. #define SQL_SS_DESCENDING_ORDER 1L
  2004. #define SQL_SS_ASCENDING_ORDER 2L
  2005. #define SQL_SS_ORDER_DEFAULT SQL_SS_ORDER_UNSPECIFIED
  2006. // Driver specific SQL data type defines.
  2007. // Microsoft has -150 thru -199 reserved for Microsoft SQL Server Native Client driver usage.
  2008. #define SQL_SS_VARIANT (-150)
  2009. #define SQL_SS_UDT (-151)
  2010. #define SQL_SS_XML (-152)
  2011. #define SQL_SS_TABLE (-153)
  2012. #define SQL_SS_TIME2 (-154)
  2013. #define SQL_SS_TIMESTAMPOFFSET (-155)
  2014. // Local types to be used with SQL_CA_SS_SERVER_TYPE
  2015. #define SQL_SS_TYPE_DEFAULT 0L
  2016. #define SQL_SS_TYPE_SMALLDATETIME 1L
  2017. #define SQL_SS_TYPE_DATETIME 2L
  2018. // Extended C Types range 4000 and above. Range of -100 thru 200 is reserved by Driver Manager.
  2019. #define SQL_C_TYPES_EXTENDED 0x04000L
  2020. #define SQL_C_SS_TIME2 (SQL_C_TYPES_EXTENDED+0)
  2021. #define SQL_C_SS_TIMESTAMPOFFSET (SQL_C_TYPES_EXTENDED+1)
  2022. #ifndef SQLNCLI_NO_BCP
  2023. // Define the symbol SQLNCLI_NO_BCP if you are not using BCP in your application
  2024. // and you want to exclude the BCP-related definitions in this header file.
  2025. // SQL Server Data Type defines.
  2026. // New types for SQL 6.0 and later servers
  2027. #define SQLTEXT 0x23
  2028. #define SQLVARBINARY 0x25
  2029. #define SQLINTN 0x26
  2030. #define SQLVARCHAR 0x27
  2031. #define SQLBINARY 0x2d
  2032. #define SQLIMAGE 0x22
  2033. #define SQLCHARACTER 0x2f
  2034. #define SQLINT1 0x30
  2035. #define SQLBIT 0x32
  2036. #define SQLINT2 0x34
  2037. #define SQLINT4 0x38
  2038. #define SQLMONEY 0x3c
  2039. #define SQLDATETIME 0x3d
  2040. #define SQLFLT8 0x3e
  2041. #define SQLFLTN 0x6d
  2042. #define SQLMONEYN 0x6e
  2043. #define SQLDATETIMN 0x6f
  2044. #define SQLFLT4 0x3b
  2045. #define SQLMONEY4 0x7a
  2046. #define SQLDATETIM4 0x3a
  2047. // New types for SQL 6.0 and later servers
  2048. #define SQLDECIMAL 0x6a
  2049. #define SQLNUMERIC 0x6c
  2050. // New types for SQL 7.0 and later servers
  2051. #define SQLUNIQUEID 0x24
  2052. #define SQLBIGCHAR 0xaf
  2053. #define SQLBIGVARCHAR 0xa7
  2054. #define SQLBIGBINARY 0xad
  2055. #define SQLBIGVARBINARY 0xa5
  2056. #define SQLBITN 0x68
  2057. #define SQLNCHAR 0xef
  2058. #define SQLNVARCHAR 0xe7
  2059. #define SQLNTEXT 0x63
  2060. // New types for SQL 2000 and later servers
  2061. #define SQLINT8 0x7f
  2062. #define SQLVARIANT 0x62
  2063. // New types for SQL 2005 and later servers
  2064. #define SQLUDT 0xf0
  2065. #define SQLXML 0xf1
  2066. // New types for SQL 2008 and later servers
  2067. #define SQLTABLE 0xf3
  2068. #define SQLDATEN 0x28
  2069. #define SQLTIMEN 0x29
  2070. #define SQLDATETIME2N 0x2a
  2071. #define SQLDATETIMEOFFSETN 0x2b
  2072. // Define old names
  2073. #define SQLDECIMALN 0x6a
  2074. #define SQLNUMERICN 0x6c
  2075. #endif // SQLNCLI_NO_BCP
  2076. // SQL_SS_LENGTH_UNLIMITED is used to describe the max length of
  2077. // VARCHAR(max), VARBINARY(max), NVARCHAR(max), and XML columns
  2078. #define SQL_SS_LENGTH_UNLIMITED 0
  2079. // User Data Type definitions.
  2080. // Returned by SQLColAttributes/SQL_CA_SS_COLUMN_UTYPE.
  2081. #define SQLudtBINARY 3
  2082. #define SQLudtBIT 16
  2083. #define SQLudtBITN 0
  2084. #define SQLudtCHAR 1
  2085. #define SQLudtDATETIM4 22
  2086. #define SQLudtDATETIME 12
  2087. #define SQLudtDATETIMN 15
  2088. #define SQLudtDECML 24
  2089. #define SQLudtDECMLN 26
  2090. #define SQLudtFLT4 23
  2091. #define SQLudtFLT8 8
  2092. #define SQLudtFLTN 14
  2093. #define SQLudtIMAGE 20
  2094. #define SQLudtINT1 5
  2095. #define SQLudtINT2 6
  2096. #define SQLudtINT4 7
  2097. #define SQLudtINTN 13
  2098. #define SQLudtMONEY 11
  2099. #define SQLudtMONEY4 21
  2100. #define SQLudtMONEYN 17
  2101. #define SQLudtNUM 10
  2102. #define SQLudtNUMN 25
  2103. #define SQLudtSYSNAME 18
  2104. #define SQLudtTEXT 19
  2105. #define SQLudtTIMESTAMP 80
  2106. #define SQLudtUNIQUEIDENTIFIER 0
  2107. #define SQLudtVARBINARY 4
  2108. #define SQLudtVARCHAR 2
  2109. #define MIN_USER_DATATYPE 256
  2110. // Aggregate operator types.
  2111. // Returned by SQLColAttributes/SQL_CA_SS_COLUMN_OP.
  2112. #define SQLAOPSTDEV 0x30 // Standard deviation
  2113. #define SQLAOPSTDEVP 0x31 // Standard deviation population
  2114. #define SQLAOPVAR 0x32 // Variance
  2115. #define SQLAOPVARP 0x33 // Variance population
  2116. #define SQLAOPCNT 0x4b // Count
  2117. #define SQLAOPSUM 0x4d // Sum
  2118. #define SQLAOPAVG 0x4f // Average
  2119. #define SQLAOPMIN 0x51 // Min
  2120. #define SQLAOPMAX 0x52 // Max
  2121. #define SQLAOPANY 0x53 // Any
  2122. #define SQLAOPNOOP 0x56 // None
  2123. // SQLGetInfo driver specific defines.
  2124. // Microsoft has 1151 thru 1200 reserved for Microsoft SQL Server Native Client driver usage.
  2125. #define SQL_INFO_SS_FIRST 1199
  2126. #define SQL_INFO_SS_NETLIB_NAMEW (SQL_INFO_SS_FIRST+0) // dbprocinfo
  2127. #define SQL_INFO_SS_NETLIB_NAMEA (SQL_INFO_SS_FIRST+1) // dbprocinfo
  2128. #define SQL_INFO_SS_MAX_USED SQL_INFO_SS_NETLIB_NAMEA
  2129. #ifdef UNICODE
  2130. #define SQL_INFO_SS_NETLIB_NAME SQL_INFO_SS_NETLIB_NAMEW
  2131. #else
  2132. #define SQL_INFO_SS_NETLIB_NAME SQL_INFO_SS_NETLIB_NAMEA
  2133. #endif
  2134. // SQLGetDiagField driver specific defines.
  2135. // Microsoft has -1150 thru -1199 reserved for Microsoft SQL Server Native Client driver usage.
  2136. #define SQL_DIAG_SS_BASE (-1150)
  2137. #define SQL_DIAG_SS_MSGSTATE (SQL_DIAG_SS_BASE)
  2138. #define SQL_DIAG_SS_SEVERITY (SQL_DIAG_SS_BASE-1)
  2139. #define SQL_DIAG_SS_SRVNAME (SQL_DIAG_SS_BASE-2)
  2140. #define SQL_DIAG_SS_PROCNAME (SQL_DIAG_SS_BASE-3)
  2141. #define SQL_DIAG_SS_LINE (SQL_DIAG_SS_BASE-4)
  2142. // SQLGetDiagField/SQL_DIAG_DYNAMIC_FUNCTION_CODE driver specific defines.
  2143. // Microsoft has -200 thru -299 reserved for Microsoft SQL Server Native Client driver usage.
  2144. #define SQL_DIAG_DFC_SS_BASE (-200)
  2145. #define SQL_DIAG_DFC_SS_ALTER_DATABASE (SQL_DIAG_DFC_SS_BASE-0)
  2146. #define SQL_DIAG_DFC_SS_CHECKPOINT (SQL_DIAG_DFC_SS_BASE-1)
  2147. #define SQL_DIAG_DFC_SS_CONDITION (SQL_DIAG_DFC_SS_BASE-2)
  2148. #define SQL_DIAG_DFC_SS_CREATE_DATABASE (SQL_DIAG_DFC_SS_BASE-3)
  2149. #define SQL_DIAG_DFC_SS_CREATE_DEFAULT (SQL_DIAG_DFC_SS_BASE-4)
  2150. #define SQL_DIAG_DFC_SS_CREATE_PROCEDURE (SQL_DIAG_DFC_SS_BASE-5)
  2151. #define SQL_DIAG_DFC_SS_CREATE_RULE (SQL_DIAG_DFC_SS_BASE-6)
  2152. #define SQL_DIAG_DFC_SS_CREATE_TRIGGER (SQL_DIAG_DFC_SS_BASE-7)
  2153. #define SQL_DIAG_DFC_SS_CURSOR_DECLARE (SQL_DIAG_DFC_SS_BASE-8)
  2154. #define SQL_DIAG_DFC_SS_CURSOR_OPEN (SQL_DIAG_DFC_SS_BASE-9)
  2155. #define SQL_DIAG_DFC_SS_CURSOR_FETCH (SQL_DIAG_DFC_SS_BASE-10)
  2156. #define SQL_DIAG_DFC_SS_CURSOR_CLOSE (SQL_DIAG_DFC_SS_BASE-11)
  2157. #define SQL_DIAG_DFC_SS_DEALLOCATE_CURSOR (SQL_DIAG_DFC_SS_BASE-12)
  2158. #define SQL_DIAG_DFC_SS_DBCC (SQL_DIAG_DFC_SS_BASE-13)
  2159. #define SQL_DIAG_DFC_SS_DISK (SQL_DIAG_DFC_SS_BASE-14)
  2160. #define SQL_DIAG_DFC_SS_DROP_DATABASE (SQL_DIAG_DFC_SS_BASE-15)
  2161. #define SQL_DIAG_DFC_SS_DROP_DEFAULT (SQL_DIAG_DFC_SS_BASE-16)
  2162. #define SQL_DIAG_DFC_SS_DROP_PROCEDURE (SQL_DIAG_DFC_SS_BASE-17)
  2163. #define SQL_DIAG_DFC_SS_DROP_RULE (SQL_DIAG_DFC_SS_BASE-18)
  2164. #define SQL_DIAG_DFC_SS_DROP_TRIGGER (SQL_DIAG_DFC_SS_BASE-19)
  2165. #define SQL_DIAG_DFC_SS_DUMP_DATABASE (SQL_DIAG_DFC_SS_BASE-20)
  2166. #define SQL_DIAG_DFC_SS_BACKUP_DATABASE (SQL_DIAG_DFC_SS_BASE-20)
  2167. #define SQL_DIAG_DFC_SS_DUMP_TABLE (SQL_DIAG_DFC_SS_BASE-21)
  2168. #define SQL_DIAG_DFC_SS_DUMP_TRANSACTION (SQL_DIAG_DFC_SS_BASE-22)
  2169. #define SQL_DIAG_DFC_SS_BACKUP_TRANSACTION (SQL_DIAG_DFC_SS_BASE-22)
  2170. #define SQL_DIAG_DFC_SS_GOTO (SQL_DIAG_DFC_SS_BASE-23)
  2171. #define SQL_DIAG_DFC_SS_INSERT_BULK (SQL_DIAG_DFC_SS_BASE-24)
  2172. #define SQL_DIAG_DFC_SS_KILL (SQL_DIAG_DFC_SS_BASE-25)
  2173. #define SQL_DIAG_DFC_SS_LOAD_DATABASE (SQL_DIAG_DFC_SS_BASE-26)
  2174. #define SQL_DIAG_DFC_SS_RESTORE_DATABASE (SQL_DIAG_DFC_SS_BASE-26)
  2175. #define SQL_DIAG_DFC_SS_LOAD_HEADERONLY (SQL_DIAG_DFC_SS_BASE-27)
  2176. #define SQL_DIAG_DFC_SS_RESTORE_HEADERONLY (SQL_DIAG_DFC_SS_BASE-27)
  2177. #define SQL_DIAG_DFC_SS_LOAD_TABLE (SQL_DIAG_DFC_SS_BASE-28)
  2178. #define SQL_DIAG_DFC_SS_LOAD_TRANSACTION (SQL_DIAG_DFC_SS_BASE-29)
  2179. #define SQL_DIAG_DFC_SS_RESTORE_TRANSACTION (SQL_DIAG_DFC_SS_BASE-29)
  2180. #define SQL_DIAG_DFC_SS_PRINT (SQL_DIAG_DFC_SS_BASE-30)
  2181. #define SQL_DIAG_DFC_SS_RAISERROR (SQL_DIAG_DFC_SS_BASE-31)
  2182. #define SQL_DIAG_DFC_SS_READTEXT (SQL_DIAG_DFC_SS_BASE-32)
  2183. #define SQL_DIAG_DFC_SS_RECONFIGURE (SQL_DIAG_DFC_SS_BASE-33)
  2184. #define SQL_DIAG_DFC_SS_RETURN (SQL_DIAG_DFC_SS_BASE-34)
  2185. #define SQL_DIAG_DFC_SS_SELECT_INTO (SQL_DIAG_DFC_SS_BASE-35)
  2186. #define SQL_DIAG_DFC_SS_SET (SQL_DIAG_DFC_SS_BASE-36)
  2187. #define SQL_DIAG_DFC_SS_SET_IDENTITY_INSERT (SQL_DIAG_DFC_SS_BASE-37)
  2188. #define SQL_DIAG_DFC_SS_SET_ROW_COUNT (SQL_DIAG_DFC_SS_BASE-38)
  2189. #define SQL_DIAG_DFC_SS_SET_STATISTICS (SQL_DIAG_DFC_SS_BASE-39)
  2190. #define SQL_DIAG_DFC_SS_SET_TEXTSIZE (SQL_DIAG_DFC_SS_BASE-40)
  2191. #define SQL_DIAG_DFC_SS_SETUSER (SQL_DIAG_DFC_SS_BASE-41)
  2192. #define SQL_DIAG_DFC_SS_SHUTDOWN (SQL_DIAG_DFC_SS_BASE-42)
  2193. #define SQL_DIAG_DFC_SS_TRANS_BEGIN (SQL_DIAG_DFC_SS_BASE-43)
  2194. #define SQL_DIAG_DFC_SS_TRANS_COMMIT (SQL_DIAG_DFC_SS_BASE-44)
  2195. #define SQL_DIAG_DFC_SS_TRANS_PREPARE (SQL_DIAG_DFC_SS_BASE-45)
  2196. #define SQL_DIAG_DFC_SS_TRANS_ROLLBACK (SQL_DIAG_DFC_SS_BASE-46)
  2197. #define SQL_DIAG_DFC_SS_TRANS_SAVE (SQL_DIAG_DFC_SS_BASE-47)
  2198. #define SQL_DIAG_DFC_SS_TRUNCATE_TABLE (SQL_DIAG_DFC_SS_BASE-48)
  2199. #define SQL_DIAG_DFC_SS_UPDATE_STATISTICS (SQL_DIAG_DFC_SS_BASE-49)
  2200. #define SQL_DIAG_DFC_SS_UPDATETEXT (SQL_DIAG_DFC_SS_BASE-50)
  2201. #define SQL_DIAG_DFC_SS_USE (SQL_DIAG_DFC_SS_BASE-51)
  2202. #define SQL_DIAG_DFC_SS_WAITFOR (SQL_DIAG_DFC_SS_BASE-52)
  2203. #define SQL_DIAG_DFC_SS_WRITETEXT (SQL_DIAG_DFC_SS_BASE-53)
  2204. #define SQL_DIAG_DFC_SS_DENY (SQL_DIAG_DFC_SS_BASE-54)
  2205. #define SQL_DIAG_DFC_SS_SET_XCTLVL (SQL_DIAG_DFC_SS_BASE-55)
  2206. #define SQL_DIAG_DFC_SS_MERGE (SQL_DIAG_DFC_SS_BASE-56)
  2207. // Severity codes for SQL_DIAG_SS_SEVERITY
  2208. #define EX_ANY 0
  2209. #define EX_INFO 10
  2210. #define EX_MAXISEVERITY EX_INFO
  2211. #define EX_MISSING 11
  2212. #define EX_TYPE 12
  2213. #define EX_DEADLOCK 13
  2214. #define EX_PERMIT 14
  2215. #define EX_SYNTAX 15
  2216. #define EX_USER 16
  2217. #define EX_RESOURCE 17
  2218. #define EX_INTOK 18
  2219. #define MAXUSEVERITY EX_INTOK
  2220. #define EX_LIMIT 19
  2221. #define EX_CMDFATAL 20
  2222. #define MINFATALERR EX_CMDFATAL
  2223. #define EX_DBFATAL 21
  2224. #define EX_TABCORRUPT 22
  2225. #define EX_DBCORRUPT 23
  2226. #define EX_HARDWARE 24
  2227. #define EX_CONTROL 25
  2228. // Internal server datatypes - used when binding to SQL_C_BINARY
  2229. #ifndef MAXNUMERICLEN // Resolve ODS/DBLib conflicts
  2230. // DB-Library datatypes
  2231. #define DBMAXCHAR (8000+1) // Max length of DBVARBINARY and DBVARCHAR, etc. +1 for zero byte
  2232. #define MAXNAME (SQL_MAX_SQLSERVERNAME+1) // Max server identifier length including zero byte
  2233. #ifdef UNICODE
  2234. typedef wchar_t DBCHAR;
  2235. #else
  2236. typedef char DBCHAR;
  2237. #endif
  2238. typedef short SQLSMALLINT;
  2239. typedef unsigned short SQLUSMALLINT;
  2240. typedef unsigned char DBBINARY;
  2241. typedef unsigned char DBTINYINT;
  2242. typedef short DBSMALLINT;
  2243. typedef unsigned short DBUSMALLINT;
  2244. typedef double DBFLT8;
  2245. typedef unsigned char DBBIT;
  2246. typedef unsigned char DBBOOL;
  2247. typedef float DBFLT4;
  2248. typedef DBFLT4 DBREAL;
  2249. typedef UINT DBUBOOL;
  2250. typedef struct dbmoney
  2251. {
  2252. LONG mnyhigh;
  2253. ULONG mnylow;
  2254. } DBMONEY;
  2255. typedef struct dbdatetime
  2256. {
  2257. LONG dtdays;
  2258. ULONG dttime;
  2259. } DBDATETIME;
  2260. typedef struct dbdatetime4
  2261. {
  2262. USHORT numdays;
  2263. USHORT nummins;
  2264. } DBDATETIM4;
  2265. typedef LONG DBMONEY4;
  2266. #include <pshpack8.h> // 8-byte structure packing
  2267. // New Date Time Structures
  2268. // New Structure for TIME2
  2269. typedef struct tagSS_TIME2_STRUCT
  2270. {
  2271. SQLUSMALLINT hour;
  2272. SQLUSMALLINT minute;
  2273. SQLUSMALLINT second;
  2274. SQLUINTEGER fraction;
  2275. } SQL_SS_TIME2_STRUCT;
  2276. // New Structure for TIMESTAMPOFFSET
  2277. typedef struct tagSS_TIMESTAMPOFFSET_STRUCT
  2278. {
  2279. SQLSMALLINT year;
  2280. SQLUSMALLINT month;
  2281. SQLUSMALLINT day;
  2282. SQLUSMALLINT hour;
  2283. SQLUSMALLINT minute;
  2284. SQLUSMALLINT second;
  2285. SQLUINTEGER fraction;
  2286. SQLSMALLINT timezone_hour;
  2287. SQLSMALLINT timezone_minute;
  2288. } SQL_SS_TIMESTAMPOFFSET_STRUCT;
  2289. #include <poppack.h> // restore original structure packing
  2290. // Money value *10,000
  2291. #define DBNUM_PREC_TYPE BYTE
  2292. #define DBNUM_SCALE_TYPE BYTE
  2293. #define DBNUM_VAL_TYPE BYTE
  2294. #if (ODBCVER < 0x0300)
  2295. #define MAXNUMERICLEN 16
  2296. typedef struct dbnumeric // Internal representation of NUMERIC data type
  2297. {
  2298. DBNUM_PREC_TYPE precision; // Precision
  2299. DBNUM_SCALE_TYPE scale; // Scale
  2300. BYTE sign; // Sign (1 if positive, 0 if negative)
  2301. DBNUM_VAL_TYPE val[MAXNUMERICLEN];// Value
  2302. } DBNUMERIC;
  2303. typedef DBNUMERIC DBDECIMAL;// Internal representation of DECIMAL data type
  2304. #else // Use ODBC 3.0 definitions since same as DBLib
  2305. #define MAXNUMERICLEN SQL_MAX_NUMERIC_LEN
  2306. typedef SQL_NUMERIC_STRUCT DBNUMERIC;
  2307. typedef SQL_NUMERIC_STRUCT DBDECIMAL;
  2308. #endif // ODCBVER
  2309. #endif // MAXNUMERICLEN
  2310. #ifndef INT
  2311. typedef int INT;
  2312. typedef long DBINT;
  2313. typedef DBINT * LPDBINT;
  2314. #ifndef _LPCBYTE_DEFINED
  2315. #define _LPCBYTE_DEFINED
  2316. typedef BYTE const* LPCBYTE;
  2317. #endif //_LPCBYTE_DEFINED
  2318. #endif // INT
  2319. /**************************************************************************
  2320. This struct is a global used for gathering statistical data on the driver.
  2321. Access to this structure is controlled via the pStatCrit;
  2322. ***************************************************************************/
  2323. typedef struct sqlperf
  2324. {
  2325. // Application Profile Statistics
  2326. DWORD TimerResolution;
  2327. DWORD SQLidu;
  2328. DWORD SQLiduRows;
  2329. DWORD SQLSelects;
  2330. DWORD SQLSelectRows;
  2331. DWORD Transactions;
  2332. DWORD SQLPrepares;
  2333. DWORD ExecDirects;
  2334. DWORD SQLExecutes;
  2335. DWORD CursorOpens;
  2336. DWORD CursorSize;
  2337. DWORD CursorUsed;
  2338. LDOUBLE PercentCursorUsed;
  2339. LDOUBLE AvgFetchTime;
  2340. LDOUBLE AvgCursorSize;
  2341. LDOUBLE AvgCursorUsed;
  2342. DWORD SQLFetchTime;
  2343. DWORD SQLFetchCount;
  2344. DWORD CurrentStmtCount;
  2345. DWORD MaxOpenStmt;
  2346. DWORD SumOpenStmt;
  2347. // Connection Statistics
  2348. DWORD CurrentConnectionCount;
  2349. DWORD MaxConnectionsOpened;
  2350. DWORD SumConnectionsOpened;
  2351. DWORD SumConnectiontime;
  2352. LDOUBLE AvgTimeOpened;
  2353. // Network Statistics
  2354. DWORD ServerRndTrips;
  2355. DWORD BuffersSent;
  2356. DWORD BuffersRec;
  2357. DWORD BytesSent;
  2358. DWORD BytesRec;
  2359. // Time Statistics;
  2360. DWORD msExecutionTime;
  2361. DWORD msNetWorkServerTime;
  2362. } SQLPERF;
  2363. // The following are options for SQL_COPT_SS_PERF_DATA and SQL_COPT_SS_PERF_QUERY
  2364. #define SQL_PERF_START 1 // Starts the driver sampling performance data.
  2365. #define SQL_PERF_STOP 2 // Stops the counters from sampling performance data.
  2366. // The following are defines for SQL_COPT_SS_PERF_DATA_LOG
  2367. #define SQL_SS_DL_DEFAULT TEXT("STATS.LOG")
  2368. // The following are defines for SQL_COPT_SS_PERF_QUERY_LOG
  2369. #define SQL_SS_QL_DEFAULT TEXT("QUERY.LOG")
  2370. // The following are defines for SQL_COPT_SS_PERF_QUERY_INTERVAL
  2371. #define SQL_SS_QI_DEFAULT 30000 // 30,000 milliseconds
  2372. #ifndef SQLNCLI_NO_BCP
  2373. // Define the symbol SQLNCLI_NO_BCP if you are not using BCP in your application
  2374. // and you want to exclude the BCP-related definitions in this header file.
  2375. // ODBC BCP prototypes and defines
  2376. // Return codes
  2377. #define SUCCEED 1
  2378. #define FAIL 0
  2379. #define SUCCEED_ABORT 2
  2380. #define SUCCEED_ASYNC 3
  2381. // Transfer directions
  2382. #define DB_IN 1 // Transfer from client to server
  2383. #define DB_OUT 2 // Transfer from server to client
  2384. // bcp_control option
  2385. #define BCPMAXERRS 1 // Sets max errors allowed
  2386. #define BCPFIRST 2 // Sets first row to be copied out
  2387. #define BCPLAST 3 // Sets number of rows to be copied out
  2388. #define BCPBATCH 4 // Sets input batch size
  2389. #define BCPKEEPNULLS 5 // Sets to insert NULLs for empty input values
  2390. #define BCPABORT 6 // Sets to have bcpexec return SUCCEED_ABORT
  2391. #define BCPODBC 7 // Sets ODBC canonical character output
  2392. #define BCPKEEPIDENTITY 8 // Sets IDENTITY_INSERT on
  2393. #if SQLNCLI_VER < 1000
  2394. #define BCP6xFILEFMT 9 // DEPRECATED: Sets 6x file format on
  2395. #endif
  2396. #define BCPHINTSA 10 // Sets server BCP hints (ANSI string)
  2397. #define BCPHINTSW 11 // Sets server BCP hints (UNICODE string)
  2398. #define BCPFILECP 12 // Sets clients code page for the file
  2399. #define BCPUNICODEFILE 13 // Sets that the file contains unicode header
  2400. #define BCPTEXTFILE 14 // Sets BCP mode to expect a text file and to detect Unicode or ANSI automatically
  2401. #define BCPFILEFMT 15 // Sets file format version
  2402. #define BCPFMTXML 16 // Sets the format file type to xml
  2403. #define BCPFIRSTEX 17 // Starting Row for BCP operation (64 bit)
  2404. #define BCPLASTEX 18 // Ending Row for BCP operation (64 bit)
  2405. #define BCPROWCOUNT 19 // Total Number of Rows Copied (64 bit)
  2406. #define BCPDELAYREADFMT 20 // Delay reading format file unil bcp_exec
  2407. // BCPFILECP values
  2408. // Any valid code page that is installed on the client can be passed plus:
  2409. #define BCPFILECP_ACP 0 // Data in file is in Windows code page
  2410. #define BCPFILECP_OEMCP 1 // Data in file is in OEM code page (default)
  2411. #define BCPFILECP_RAW (-1)// Data in file is in Server code page (no conversion)
  2412. // bcp_collen definition
  2413. #define SQL_VARLEN_DATA (-10) // Use default length for column
  2414. // BCP column format properties
  2415. #define BCP_FMT_TYPE 0x01
  2416. #define BCP_FMT_INDICATOR_LEN 0x02
  2417. #define BCP_FMT_DATA_LEN 0x03
  2418. #define BCP_FMT_TERMINATOR 0x04
  2419. #define BCP_FMT_SERVER_COL 0x05
  2420. #define BCP_FMT_COLLATION 0x06
  2421. #define BCP_FMT_COLLATION_ID 0x07
  2422. // bcp_setbulkmode properties
  2423. #define BCP_OUT_CHARACTER_MODE 0x01
  2424. #define BCP_OUT_WIDE_CHARACTER_MODE 0x02
  2425. #define BCP_OUT_NATIVE_TEXT_MODE 0x03
  2426. #define BCP_OUT_NATIVE_MODE 0x04
  2427. // BCP functions
  2428. DBINT SQL_API bcp_batch (HDBC);
  2429. RETCODE SQL_API bcp_bind (HDBC, LPCBYTE, INT, DBINT, LPCBYTE, INT, INT, INT);
  2430. RETCODE SQL_API bcp_colfmt (HDBC, INT, BYTE, INT, DBINT, LPCBYTE, INT, INT);
  2431. RETCODE SQL_API bcp_collen (HDBC, DBINT, INT);
  2432. RETCODE SQL_API bcp_colptr (HDBC, LPCBYTE, INT);
  2433. RETCODE SQL_API bcp_columns (HDBC, INT);
  2434. RETCODE SQL_API bcp_control (HDBC, INT, void *);
  2435. DBINT SQL_API bcp_done (HDBC);
  2436. RETCODE SQL_API bcp_exec (HDBC, LPDBINT);
  2437. RETCODE SQL_API bcp_getcolfmt (HDBC, INT, INT, void *, INT, INT *);
  2438. RETCODE SQL_API bcp_initA (HDBC, LPCSTR, LPCSTR, LPCSTR, INT);
  2439. RETCODE SQL_API bcp_initW (HDBC, LPCWSTR, LPCWSTR, LPCWSTR, INT);
  2440. RETCODE SQL_API bcp_moretext (HDBC, DBINT, LPCBYTE);
  2441. RETCODE SQL_API bcp_readfmtA (HDBC, LPCSTR);
  2442. RETCODE SQL_API bcp_readfmtW (HDBC, LPCWSTR);
  2443. RETCODE SQL_API bcp_sendrow (HDBC);
  2444. RETCODE SQL_API bcp_setbulkmode (HDBC, INT, __in_bcount(cbField) void*, INT cbField, __in_bcount(cbRow) void *, INT cbRow);
  2445. RETCODE SQL_API bcp_setcolfmt (HDBC, INT, INT, void *, INT);
  2446. RETCODE SQL_API bcp_writefmtA (HDBC, LPCSTR);
  2447. RETCODE SQL_API bcp_writefmtW (HDBC, LPCWSTR);
  2448. CHAR* SQL_API dbprtypeA (INT);
  2449. WCHAR* SQL_API dbprtypeW (INT);
  2450. CHAR* SQL_API bcp_gettypenameA (INT, DBBOOL);
  2451. WCHAR* SQL_API bcp_gettypenameW (INT, DBBOOL);
  2452. #ifdef UNICODE
  2453. #define bcp_init bcp_initW
  2454. #define bcp_readfmt bcp_readfmtW
  2455. #define bcp_writefmt bcp_writefmtW
  2456. #define dbprtype dbprtypeW
  2457. #define bcp_gettypename bcp_gettypenameW
  2458. #define BCPHINTS BCPHINTSW
  2459. #else
  2460. #define bcp_init bcp_initA
  2461. #define bcp_readfmt bcp_readfmtA
  2462. #define bcp_writefmt bcp_writefmtA
  2463. #define dbprtype dbprtypeA
  2464. #define bcp_gettypename bcp_gettypenameA
  2465. #define BCPHINTS BCPHINTSA
  2466. #endif // UNICODE
  2467. #endif // SQLNCLI_NO_BCP
  2468. // The following options have been deprecated
  2469. #define SQL_FAST_CONNECT (SQL_COPT_SS_BASE+0)
  2470. // Defines for use with SQL_FAST_CONNECT - only useable before connecting
  2471. #define SQL_FC_OFF 0L // Fast connect is off
  2472. #define SQL_FC_ON 1L // Fast connect is on
  2473. #define SQL_FC_DEFAULT SQL_FC_OFF
  2474. #define SQL_COPT_SS_ANSI_OEM (SQL_COPT_SS_BASE+6)
  2475. #define SQL_AO_OFF 0L
  2476. #define SQL_AO_ON 1L
  2477. #define SQL_AO_DEFAULT SQL_AO_OFF
  2478. #define SQL_CA_SS_BASE_COLUMN_NAME SQL_DESC_BASE_COLUMN_NAME
  2479. #endif // ODBCVER
  2480. #endif // defined(_SQLNCLI_ODBC_) || !defined(_SQLNCLI_OLEDB_)
  2481. // ODBC part of SQL Server Native Client header - end here!
  2482. //The following facilitates opening a handle to a SQL filestream
  2483. typedef enum _SQL_FILESTREAM_DESIRED_ACCESS {
  2484. SQL_FILESTREAM_READ = 0,
  2485. SQL_FILESTREAM_WRITE = 1,
  2486. SQL_FILESTREAM_READWRITE = 2
  2487. } SQL_FILESTREAM_DESIRED_ACCESS;
  2488. #define SQL_FILESTREAM_OPEN_FLAG_ASYNC 0x00000001L
  2489. #define SQL_FILESTREAM_OPEN_FLAG_NO_BUFFERING 0x00000002L
  2490. #define SQL_FILESTREAM_OPEN_FLAG_NO_WRITE_THROUGH 0x00000004L
  2491. #define SQL_FILESTREAM_OPEN_FLAG_SEQUENTIAL_SCAN 0x00000008L
  2492. #define SQL_FILESTREAM_OPEN_FLAG_RANDOM_ACCESS 0x00000010L
  2493. HANDLE __stdcall OpenSqlFilestream (
  2494. LPCWSTR FilestreamPath,
  2495. SQL_FILESTREAM_DESIRED_ACCESS DesiredAccess,
  2496. ULONG OpenOptions,
  2497. LPBYTE FilestreamTransactionContext,
  2498. SSIZE_T FilestreamTransactionContextLength,
  2499. PLARGE_INTEGER AllocationSize);
  2500. #define FSCTL_SQL_FILESTREAM_FETCH_OLD_CONTENT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2392, METHOD_BUFFERED, FILE_ANY_ACCESS)
  2501. #ifndef _SQLUSERINSTANCE_H_
  2502. #define _SQLUSERINSTANCE_H_
  2503. #include <windows.h>
  2504. #ifdef __cplusplus
  2505. extern "C" {
  2506. #endif
  2507. // Recommended buffer size to store a LocalDB connection string
  2508. #define LOCALDB_MAX_SQLCONNECTION_BUFFER_SIZE 260
  2509. // type definition for LocalDBCreateInstance function
  2510. typedef HRESULT __cdecl FnLocalDBCreateInstance (
  2511. // I the LocalDB version (e.g. 11.0 or 11.0.1094.2)
  2512. __in_z PCWSTR wszVersion,
  2513. // I the instance name
  2514. __in_z PCWSTR pInstanceName,
  2515. // I reserved for the future use. Currently should be set to 0.
  2516. __in DWORD dwFlags
  2517. );
  2518. // type definition for pointer to LocalDBCreateInstance function
  2519. typedef FnLocalDBCreateInstance* PFnLocalDBCreateInstance;
  2520. // type definition for LocalDBStartInstance function
  2521. typedef HRESULT __cdecl FnLocalDBStartInstance (
  2522. // I the LocalDB instance name
  2523. __in_z PCWSTR pInstanceName,
  2524. // I reserved for the future use. Currently should be set to 0.
  2525. __in DWORD dwFlags,
  2526. // O the buffer to store the connection string to the LocalDB instance
  2527. __out_ecount_z_opt(*lpcchSqlConnection) LPWSTR wszSqlConnection,
  2528. // I/O on input has the size of the wszSqlConnection buffer in characters. On output, if the given buffer size is
  2529. // too small, has the buffer size required, in characters, including trailing null.
  2530. __inout_opt LPDWORD lpcchSqlConnection
  2531. );
  2532. // type definition for pointer to LocalDBStartInstance function
  2533. typedef FnLocalDBStartInstance* PFnLocalDBStartInstance;
  2534. // Flags for the LocalDBFormatMessage function
  2535. #define LOCALDB_TRUNCATE_ERR_MESSAGE 0x0001L
  2536. // type definition for LocalDBFormatMessage function
  2537. typedef HRESULT __cdecl FnLocalDBFormatMessage(
  2538. // I the LocalDB error code
  2539. __in HRESULT hrLocalDB,
  2540. // I Available flags:
  2541. // LOCALDB_TRUNCATE_ERR_MESSAGE - if the input buffer is too short,
  2542. // the error message will be truncated to fit into the buffer
  2543. __in DWORD dwFlags,
  2544. // I Language desired (LCID) or 0 (in which case Win32 FormatMessage order is used)
  2545. __in DWORD dwLanguageId,
  2546. // O the buffer to store the LocalDB error message
  2547. __out_ecount_z(*lpcchMessage) LPWSTR wszMessage,
  2548. // I/O on input has the size of the wszMessage buffer in characters. On output, if the given buffer size is
  2549. // too small, has the buffer size required, in characters, including trailing null. If the function succeeds
  2550. // contains the number of characters in the message, excluding the trailing null
  2551. __inout LPDWORD lpcchMessage
  2552. );
  2553. // type definition for function pointer to LocalDBFormatMessage function
  2554. typedef FnLocalDBFormatMessage* PFnLocalDBFormatMessage;
  2555. // MessageId: LOCALDB_ERROR_NOT_INSTALLED
  2556. //
  2557. // MessageText:
  2558. //
  2559. // Local Database is not installed.
  2560. //
  2561. #define LOCALDB_ERROR_NOT_INSTALLED ((HRESULT)0x89C50116L)
  2562. //---------------------------------------------------------------------
  2563. // Function: LocalDBCreateInstance
  2564. //
  2565. // Description: This function will create the new LocalDB instance.
  2566. //
  2567. // Available Flags:
  2568. // No flags available. Reserved for future use.
  2569. //
  2570. // Return Values:
  2571. // S_OK, if the function succeeds
  2572. // LOCALDB_ERROR_INVALID_PARAM_INSTANCE_NAME, if the instance name parameter is invalid
  2573. // LOCALDB_ERROR_INVALID_PARAM_VERSION, if the version parameter is invalid
  2574. // LOCALDB_ERROR_INVALID_PARAM_FLAGS, if the flags are invalid
  2575. // LOCALDB_ERROR_INVALID_OPERATION, if the user tries to create a default instance
  2576. // LOCALDB_ERROR_INSTANCE_FOLDER_PATH_TOO_LONG, if the path where instance should be stored is longer than MAX_PATH
  2577. // LOCALDB_ERROR_VERSION_REQUESTED_NOT_INSTALLED, if the specified patch level is not installed
  2578. // LOCALDB_ERROR_INSTANCE_FOLDER_ALREADY_EXISTS, if the instance folder already exists and is not empty
  2579. // LOCALDB_ERROR_INSTANCE_EXISTS_WITH_LOWER_VERSION, if the specified instance already exists but with lower version
  2580. // LOCALDB_ERROR_CANNOT_CREATE_INSTANCE_FOLDER, if a folder cannot be created under %userprofile%
  2581. // LOCALDB_ERROR_CANNOT_GET_USER_PROFILE_FOLDER, if a user profile folder cannot be retrieved
  2582. // LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_FOLDER, if a instance folder cannot be accessed
  2583. // LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_REGISTRY, if a instance registry cannot be accessed
  2584. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurred. See event log for details
  2585. // LOCALDB_ERROR_CANNOT_MODIFY_INSTANCE_REGISTRY, if an instance registry cannot be modified
  2586. // LOCALDB_ERROR_CANNOT_CREATE_SQL_PROCESS, if a process for Sql Server cannot be created
  2587. // LOCALDB_ERROR_SQL_SERVER_STARTUP_FAILED, if a Sql Server process is started but Sql Server startup failed.
  2588. // LOCALDB_ERROR_INSTANCE_CONFIGURATION_CORRUPT, if a instance configuration is corrupted
  2589. //
  2590. FnLocalDBCreateInstance LocalDBCreateInstance;
  2591. //---------------------------------------------------------------------
  2592. // Function: LocalDBStartInstance
  2593. //
  2594. // Description: This function will start the given LocalDB instance.
  2595. //
  2596. // Return Values:
  2597. // S_OK, if the function succeeds
  2598. // LOCALDB_ERROR_UNKNOWN_INSTANCE, if the specified instance doesn't exist
  2599. // LOCALDB_ERROR_INVALID_PARAM_INSTANCE_NAME, if the instance name parameter is invalid
  2600. // LOCALDB_ERROR_INVALID_PARAM_CONNECTION, if the wszSqlConnection parameter is NULL
  2601. // LOCALDB_ERROR_INVALID_PARAM_FLAGS, if the flags are invalid
  2602. // LOCALDB_ERROR_INSUFFICIENT_BUFFER, if the buffer wszSqlConnection is too small
  2603. // LOCALDB_ERROR_INSTANCE_FOLDER_PATH_TOO_LONG, if the path where instance should be stored is longer than MAX_PATH
  2604. // LOCALDB_ERROR_CANNOT_GET_USER_PROFILE_FOLDER, if a user profile folder cannot be retrieved
  2605. // LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_FOLDER, if a instance folder cannot be accessed
  2606. // LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_REGISTRY, if a instance registry cannot be accessed
  2607. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurred. See event log for details
  2608. // LOCALDB_ERROR_CANNOT_MODIFY_INSTANCE_REGISTRY, if an instance registry cannot be modified
  2609. // LOCALDB_ERROR_CANNOT_CREATE_SQL_PROCESS, if a process for Sql Server cannot be created
  2610. // LOCALDB_ERROR_SQL_SERVER_STARTUP_FAILED, if a Sql Server process is started but Sql Server startup failed.
  2611. // LOCALDB_ERROR_INSTANCE_CONFIGURATION_CORRUPT, if a instance configuration is corrupted
  2612. //
  2613. FnLocalDBStartInstance LocalDBStartInstance;
  2614. // type definition for LocalDBStopInstance function
  2615. typedef HRESULT __cdecl FnLocalDBStopInstance (
  2616. // I the LocalDB instance name
  2617. __in_z PCWSTR pInstanceName,
  2618. // I Available flags:
  2619. // LOCALDB_SHUTDOWN_KILL_PROCESS - force the instance to stop immediately
  2620. // LOCALDB_SHUTDOWN_WITH_NOWAIT - shutdown the instance with NOWAIT option
  2621. __in DWORD dwFlags,
  2622. // I the time in seconds to wait this operation to complete. If this value is 0, this function will return immediately
  2623. // without waiting for LocalDB instance to stop
  2624. __in ULONG ulTimeout
  2625. );
  2626. // type definition for pointer to LocalDBStopInstance function
  2627. typedef FnLocalDBStopInstance* PFnLocalDBStopInstance;
  2628. // Flags for the StopLocalDBInstance function
  2629. #define LOCALDB_SHUTDOWN_KILL_PROCESS 0x0001L
  2630. #define LOCALDB_SHUTDOWN_WITH_NOWAIT 0x0002L
  2631. //---------------------------------------------------------------------
  2632. // Function: LocalDBStopInstance
  2633. //
  2634. // Description: This function will shutdown the given LocalDB instance.
  2635. // If the flag LOCALDB_SHUTDOWN_KILL_PROCESS is set, the LocalDB instance will be killed immediately.
  2636. // IF the flag LOCALDB_SHUTDOWN_WITH_NOWAIT is set, the LocalDB instance will shutdown with NOWAIT option.
  2637. //
  2638. // Return Values:
  2639. // S_OK, if the function succeeds
  2640. // LOCALDB_ERROR_UNKNOWN_INSTANCE, if the specified instance doesn't exist
  2641. // LOCALDB_ERROR_INVALID_PARAM_INSTANCE_NAME, if the instance name parameter is invalid
  2642. // LOCALDB_ERROR_INVALID_PARAM_FLAGS, if the flags are invalid
  2643. // LOCALDB_ERROR_WAIT_TIMEOUT - if this function has not finished in given time
  2644. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurred. See event log for details
  2645. //
  2646. FnLocalDBStopInstance LocalDBStopInstance;
  2647. // type definition for LocalDBDeleteInstance function
  2648. typedef HRESULT __cdecl FnLocalDBDeleteInstance (
  2649. // I the LocalDB instance name
  2650. __in_z PCWSTR pInstanceName,
  2651. // I reserved for the future use. Currently should be set to 0.
  2652. __in DWORD dwFlags
  2653. );
  2654. // type definition for pointer to LocalDBDeleteInstance function
  2655. typedef FnLocalDBDeleteInstance* PFnLocalDBDeleteInstance;
  2656. //---------------------------------------------------------------------
  2657. // Function: LocalDBDeleteInstance
  2658. //
  2659. // Description: This function will remove the given LocalDB instance. If the given instance is running this function will
  2660. // fail with the error code LOCALDB_ERROR_INSTANCE_BUSY.
  2661. //
  2662. // Return Values:
  2663. // S_OK, if the function succeeds
  2664. // LOCALDB_ERROR_INVALID_PARAM_INSTANCE_NAME, if the instance name parameter is invalid
  2665. // LOCALDB_ERROR_INVALID_PARAM_FLAGS, if the flags are invalid
  2666. // LOCALDB_ERROR_UNKNOWN_INSTANCE, if the specified instance doesn't exist
  2667. // LOCALDB_ERROR_INSTANCE_BUSY, if the given instance is running
  2668. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurred. See event log for details
  2669. //
  2670. FnLocalDBDeleteInstance LocalDBDeleteInstance;
  2671. // Function: LocalDBFormatMessage
  2672. //
  2673. // Description: This function will return the localized textual description for the given LocalDB error
  2674. //
  2675. // Available Flags:
  2676. // LOCALDB_TRUNCATE_ERR_MESSAGE - the error message should be truncated to fit into the provided buffer
  2677. //
  2678. // Return Value:
  2679. // S_OK, if the function succeeds
  2680. //
  2681. // LOCALDB_ERROR_UNKNOWN_HRESULT, if the given HRESULT is unknown
  2682. // LOCALDB_ERROR_UNKNOWN_LANGUAGE_ID, if the given language id is unknown (0 is recommended for the // default language)
  2683. // LOCALDB_ERROR_UNKNOWN_ERROR_CODE, if the LocalDB error code is unknown
  2684. // LOCALDB_ERROR_INVALID_PARAM_FLAGS, if the flags are invalid
  2685. // LOCALDB_ERROR_INSUFFICIENT_BUFFER, if the input buffer is too short and LOCALDB_TRUNCATE_ERR_MESSAGE flag
  2686. // is not set
  2687. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurred. See event log for details
  2688. //
  2689. FnLocalDBFormatMessage LocalDBFormatMessage;
  2690. #define MAX_LOCALDB_INSTANCE_NAME_LENGTH 128
  2691. #define MAX_LOCALDB_PARENT_INSTANCE_LENGTH MAX_INSTANCE_NAME
  2692. typedef WCHAR TLocalDBInstanceName[MAX_LOCALDB_INSTANCE_NAME_LENGTH + 1];
  2693. typedef TLocalDBInstanceName* PTLocalDBInstanceName;
  2694. // type definition for LocalDBGetInstances function
  2695. typedef HRESULT __cdecl FnLocalDBGetInstances(
  2696. // O buffer for a LocalDB instance names
  2697. __out PTLocalDBInstanceName pInstanceNames,
  2698. // I/O on input has the number slots for instance names in the pInstanceNames buffer. On output,
  2699. // has the number of existing LocalDB instances
  2700. __inout LPDWORD lpdwNumberOfInstances
  2701. );
  2702. // type definition for pointer to LocalDBGetInstances function
  2703. typedef FnLocalDBGetInstances* PFnLocalDBGetInstances;
  2704. // Function: LocalDBGetInstances
  2705. //
  2706. // Description: This function returns names for all existing Local DB instances
  2707. //
  2708. // Usage Example:
  2709. // DWORD dwN = 0;
  2710. // LocalDBGetInstances(NULL, &dwN);
  2711. // PTLocalDBInstanceName insts = (PTLocalDBInstanceName) malloc(dwN * sizeof(TLocalDBInstanceName));
  2712. // LocalDBGetInstances(insts, &dwN);
  2713. // for (int i = 0; i < dwN; i++)
  2714. // wprintf(L"%s\n", insts[i]);
  2715. //
  2716. // Return values:
  2717. // S_OK, if the function succeeds
  2718. //
  2719. // LOCALDB_ERROR_INSUFFICIENT_BUFFER, the given buffer is to small
  2720. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurred. See event log for details
  2721. //
  2722. FnLocalDBGetInstances LocalDBGetInstances;
  2723. // SID string format: S - Revision(1B) - Authority ID (6B) {- Sub authority ID (4B)} * max 15 sub-authorities = 1 + 1 + 3 + 1 + 15 + (1 + 10) * 15
  2724. #define MAX_STRING_SID_LENGTH 186
  2725. #pragma pack(push)
  2726. #pragma pack(8)
  2727. // DEVNOTE: If you want to modify this structure please read DEVNOTEs on top of function LocalDBGetInstanceInfo in sqluserinstance.cpp file.
  2728. //
  2729. typedef struct _LocalDBInstanceInfo
  2730. {
  2731. DWORD cbLocalDBInstanceInfoSize;
  2732. TLocalDBInstanceName wszInstanceName;
  2733. BOOL bExists;
  2734. BOOL bConfigurationCorrupted;
  2735. BOOL bIsRunning;
  2736. DWORD dwMajor;
  2737. DWORD dwMinor;
  2738. DWORD dwBuild;
  2739. DWORD dwRevision;
  2740. FILETIME ftLastStartDateUTC;
  2741. WCHAR wszConnection[LOCALDB_MAX_SQLCONNECTION_BUFFER_SIZE];
  2742. BOOL bIsShared;
  2743. TLocalDBInstanceName wszSharedInstanceName;
  2744. WCHAR wszOwnerSID[MAX_STRING_SID_LENGTH + 1];
  2745. BOOL bIsAutomatic;
  2746. } LocalDBInstanceInfo;
  2747. #pragma pack(pop)
  2748. typedef LocalDBInstanceInfo* PLocalDBInstanceInfo;
  2749. // type definition for LocalDBGetInstanceInfo function
  2750. typedef HRESULT __cdecl FnLocalDBGetInstanceInfo(
  2751. // I the LocalDB instance name
  2752. __in_z PCWSTR wszInstanceName,
  2753. // O instance information
  2754. __out PLocalDBInstanceInfo pInfo,
  2755. // I Size of LocalDBVersionInfo structure in bytes
  2756. __in DWORD cbInfo);
  2757. // type definition for pointer to LocalDBGetInstances function
  2758. typedef FnLocalDBGetInstanceInfo* PFnLocalDBGetInstanceInfo;
  2759. // Function: LocalDBGetInstanceInfo
  2760. //
  2761. // Description: This function returns information about the given instance.
  2762. //
  2763. // Return values:
  2764. // S_OK, if the function succeeds
  2765. //
  2766. // ERROR_INVALID_PARAMETER, if some of the parameters is invalid
  2767. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurred. See event log for details
  2768. //
  2769. FnLocalDBGetInstanceInfo LocalDBGetInstanceInfo;
  2770. // Version has format: Major.Minor[.Build[.Revision]]. Each of components is 32bit integer which is at most 40 digits and 3 dots
  2771. //
  2772. #define MAX_LOCALDB_VERSION_LENGTH 43
  2773. typedef WCHAR TLocalDBVersion[MAX_LOCALDB_VERSION_LENGTH + 1];
  2774. typedef TLocalDBVersion* PTLocalDBVersion;
  2775. // type definition for LocalDBGetVersions function
  2776. typedef HRESULT __cdecl FnLocalDBGetVersions(
  2777. // O buffer for installed LocalDB versions
  2778. __out PTLocalDBVersion pVersions,
  2779. // I/O on input has the number slots for versions in the pVersions buffer. On output,
  2780. // has the number of existing LocalDB versions
  2781. __inout LPDWORD lpdwNumberOfVersions
  2782. );
  2783. // type definition for pointer to LocalDBGetVersions function
  2784. typedef FnLocalDBGetVersions* PFnLocalDBGetVersions;
  2785. // Function: LocalDBGetVersions
  2786. //
  2787. // Description: This function returns all installed LocalDB versions. Returned versions will be in format Major.Minor
  2788. //
  2789. // Usage Example:
  2790. // DWORD dwN = 0;
  2791. // LocalDBGetVersions(NULL, &dwN);
  2792. // PTLocalDBVersion versions = (PTLocalDBVersion) malloc(dwN * sizeof(TLocalDBVersion));
  2793. // LocalDBGetVersions(insts, &dwN);
  2794. // for (int i = 0; i < dwN; i++)
  2795. // wprintf(L"%s\n", insts[i]);
  2796. //
  2797. // Return values:
  2798. // S_OK, if the function succeeds
  2799. //
  2800. // LOCALDB_ERROR_INSUFFICIENT_BUFFER, the given buffer is to small
  2801. // LOCALDB_ERROR_INTERNAL_ERROR, if an unexpected error occurs.
  2802. //
  2803. FnLocalDBGetVersions LocalDBGetVersions;
  2804. #pragma pack(push)
  2805. #pragma pack(8)
  2806. // DEVNOTE: If you want to modify this structure please read DEVNOTEs on top of function LocalDBGetVersionInfo in sqluserinstance.cpp file.
  2807. //
  2808. typedef struct _LocalDBVersionInfo
  2809. {
  2810. DWORD cbLocalDBVersionInfoSize;
  2811. TLocalDBVersion wszVersion;
  2812. BOOL bExists;
  2813. DWORD dwMajor;
  2814. DWORD dwMinor;
  2815. DWORD dwBuild;
  2816. DWORD dwRevision;
  2817. } LocalDBVersionInfo;
  2818. #pragma pack(pop)
  2819. typedef LocalDBVersionInfo* PLocalDBVersionInfo;
  2820. // type definition for LocalDBGetVersionInfo function
  2821. typedef HRESULT __cdecl FnLocalDBGetVersionInfo(
  2822. // I LocalDB version string
  2823. __in_z PCWSTR wszVersion,
  2824. // O version information
  2825. __out PLocalDBVersionInfo pVersionInfo,
  2826. // I Size of LocalDBVersionInfo structure in bytes
  2827. __in DWORD cbVersionInfo
  2828. );
  2829. // type definition for pointer to LocalDBGetVersionInfo function
  2830. typedef FnLocalDBGetVersionInfo* PFnLocalDBGetVersionInfo;
  2831. // Function: LocalDBGetVersionInfo
  2832. //
  2833. // Description: This function returns information about the given LocalDB version
  2834. //
  2835. // Return values:
  2836. // S_OK, if the function succeeds
  2837. // LOCALDB_ERROR_INTERNAL_ERROR, if some internal error occurred
  2838. // LOCALDB_ERROR_INVALID_PARAMETER, if a input parameter is invalid
  2839. //
  2840. FnLocalDBGetVersionInfo LocalDBGetVersionInfo;
  2841. typedef HRESULT __cdecl FnLocalDBStartTracing();
  2842. typedef FnLocalDBStartTracing* PFnLocalDBStartTracing;
  2843. // Function: LocalDBStartTracing
  2844. //
  2845. // Description: This function will write in registry that Tracing sessions should be started for the current user.
  2846. //
  2847. // Return values:
  2848. // S_OK - on success
  2849. // Propper HRESULT in case of failure
  2850. //
  2851. FnLocalDBStartTracing LocalDBStartTracing;
  2852. typedef HRESULT __cdecl FnLocalDBStopTracing();
  2853. typedef FnLocalDBStopTracing* PFnFnLocalDBStopTracing;
  2854. // Function: LocalDBStopTracing
  2855. //
  2856. // Description: This function will write in registry that Tracing sessions should be stopped for the current user.
  2857. //
  2858. // Return values:
  2859. // S_OK - on success
  2860. // Propper HRESULT in case of failure
  2861. //
  2862. FnLocalDBStopTracing LocalDBStopTracing;
  2863. // type definition for LocalDBShareInstance function
  2864. typedef HRESULT __cdecl FnLocalDBShareInstance(
  2865. // I the SID of the LocalDB instance owner
  2866. __in_opt PSID pOwnerSID,
  2867. // I the private name of LocalDB instance which should be shared
  2868. __in_z PCWSTR wszPrivateLocalDBInstanceName,
  2869. // I the public shared name
  2870. __in_z PCWSTR wszSharedName,
  2871. // I reserved for the future use. Currently should be set to 0.
  2872. __in DWORD dwFlags);
  2873. // type definition for pointer to LocalDBShareInstance function
  2874. typedef FnLocalDBShareInstance* PFnLocalDBShareInstance;
  2875. // Function: LocalDBShareInstance
  2876. //
  2877. // Description: This function will share the given private instance of the given user with the given shared name.
  2878. // This function has to be executed elevated.
  2879. //
  2880. // Return values:
  2881. // HRESULT
  2882. //
  2883. FnLocalDBShareInstance LocalDBShareInstance;
  2884. // type definition for LocalDBUnshareInstance function
  2885. typedef HRESULT __cdecl FnLocalDBUnshareInstance(
  2886. // I the LocalDB instance name
  2887. __in_z PCWSTR pInstanceName,
  2888. // I reserved for the future use. Currently should be set to 0.
  2889. __in DWORD dwFlags);
  2890. // type definition for pointer to LocalDBUnshareInstance function
  2891. typedef FnLocalDBUnshareInstance* PFnLocalDBUnshareInstance;
  2892. // Function: LocalDBUnshareInstance
  2893. //
  2894. // Description: This function unshares the given LocalDB instance.
  2895. // If a shared name is given then that shared instance will be unshared.
  2896. // If a private name is given then we will check if the caller
  2897. // shares a private instance with the given private name and unshare it.
  2898. //
  2899. // Return values:
  2900. // HRESULT
  2901. //
  2902. FnLocalDBUnshareInstance LocalDBUnshareInstance;
  2903. // type definition for LocalDBGetSharedName function
  2904. typedef HRESULT __cdecl FnLocalDBGetSharedName(
  2905. // I the SID of the LocalDB instance owner
  2906. __in_opt PSID pOwnerSID,
  2907. // I the private name of LocalDB instance whose shared name should be returned
  2908. __in_z PCWSTR wszPrivateLocalDBInstanceName,
  2909. // O the shared name
  2910. __out_ecount_z_opt(MAX_LOCALDB_INSTANCE_NAME_LENGTH + 1) LPWSTR wszSharedName);
  2911. // type definition for pointer to LocalDBGetSharedName function
  2912. typedef FnLocalDBGetSharedName* PFnLocalDBGetSharedName;
  2913. // Function: LocalDBGetSharedName
  2914. //
  2915. // Description: For given private LocalDB instance name and owner of that instance, this function will return
  2916. // if that private instance is shared and the name of the shared instance (in case if it is shared).
  2917. //
  2918. // Return values:
  2919. // S_OK - if operation is successful
  2920. // LOCALDB_ERROR_INSTANCE_NOT_SHARED - if the given LocalDB private instance is not shared
  2921. // LOCALDB_ERROR_INTERNAL_ERROR - if an internal error occured
  2922. //
  2923. FnLocalDBGetSharedName LocalDBGetSharedName;
  2924. #ifdef __cplusplus
  2925. } // extern "C"
  2926. #endif
  2927. #if defined(LOCALDB_DEFINE_PROXY_FUNCTIONS)
  2928. //---------------------------------------------------------------------
  2929. // The following section is enabled only if the constant LOCALDB_DEFINE_PROXY_FUNCTIONS
  2930. // is defined. It provides an implementation of proxies for each of the LocalDB APIs.
  2931. // The proxy implementations use a common function to bind to entry points in the
  2932. // latest installed SqlUserInstance DLL, and then forward the requests.
  2933. //
  2934. // The current implementation loads the SqlUserInstance DLL on the first call into
  2935. // a proxy function. There is no provision for unloading the DLL. Note that if the
  2936. // process includes multiple binaries (EXE and one or more DLLs), each of them could
  2937. // load a separate instance of the SqlUserInstance DLL.
  2938. //
  2939. // For future consideration: allow the SqlUserInstance DLL to be unloaded dynamically.
  2940. //
  2941. // WARNING: these functions must not be called in DLL initialization, since a deadlock
  2942. // could result loading dependent DLLs.
  2943. //---------------------------------------------------------------------
  2944. // This macro provides the body for each proxy function.
  2945. //
  2946. #define LOCALDB_PROXY(LocalDBFn) static Fn##LocalDBFn* pfn##LocalDBFn = NULL; if (!pfn##LocalDBFn) {HRESULT hr = LocalDBGetPFn(#LocalDBFn, (FARPROC *)&pfn##LocalDBFn); if (FAILED(hr)) return hr;} return (*pfn##LocalDBFn)
  2947. // Structure and function to parse the "Installed Versions" registry subkeys
  2948. //
  2949. typedef struct {
  2950. DWORD dwComponent[2];
  2951. WCHAR wszKeyName[256];
  2952. } Version;
  2953. // The following algorithm is intended to match, in part, the .NET Version class.
  2954. // A maximum of two components are allowed, which must be separated with a period.
  2955. // Valid: "11", "11.0"
  2956. // Invalid: "", ".0", "11.", "11.0."
  2957. //
  2958. static BOOL ParseVersion(Version * pVersion)
  2959. {
  2960. pVersion->dwComponent[0] = 0;
  2961. pVersion->dwComponent[1] = 0;
  2962. WCHAR * pwch = pVersion->wszKeyName;
  2963. for (int i = 0; i<2; i++)
  2964. {
  2965. LONGLONG llVal = 0;
  2966. BOOL fHaveDigit = FALSE;
  2967. while (*pwch >= L'0' && *pwch <= L'9')
  2968. {
  2969. llVal = llVal * 10 + (*pwch++ - L'0');
  2970. fHaveDigit = TRUE;
  2971. if (llVal > 0x7fffffff)
  2972. {
  2973. return FALSE;
  2974. }
  2975. }
  2976. if (!fHaveDigit)
  2977. return FALSE;
  2978. pVersion->dwComponent[i] = (DWORD) llVal;
  2979. if (*pwch == L'\0')
  2980. return TRUE;
  2981. if (*pwch != L'.')
  2982. return FALSE;
  2983. pwch++;
  2984. }
  2985. // If we get here, the version string was terminated with L'.', which is not valid
  2986. //
  2987. return FALSE;
  2988. }
  2989. #include <assert.h>
  2990. // This function loads the correct LocalDB API DLL (if required) and returns a pointer to a procedure.
  2991. // Note that the first-loaded API DLL for the process will be used until process termination: installation of
  2992. // a new version of the API will not be recognized after first load.
  2993. //
  2994. static HRESULT LocalDBGetPFn(LPCSTR szLocalDBFn, FARPROC *pfnLocalDBFn)
  2995. {
  2996. static volatile HMODULE hLocalDBDll = NULL;
  2997. if (!hLocalDBDll)
  2998. {
  2999. LONG ec;
  3000. HKEY hkeyVersions = NULL;
  3001. HKEY hkeyVersion = NULL;
  3002. Version verHigh = {0};
  3003. Version verCurrent;
  3004. DWORD cchKeyName;
  3005. DWORD dwValueType;
  3006. WCHAR wszLocalDBDll[MAX_PATH+1];
  3007. DWORD cbLocalDBDll = sizeof(wszLocalDBDll) - sizeof(WCHAR); // to deal with RegQueryValueEx null-termination quirk
  3008. HMODULE hLocalDBDllTemp = NULL;
  3009. if (ERROR_SUCCESS != (ec = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Microsoft SQL Server Local DB\\Installed Versions", 0, KEY_READ, &hkeyVersions)))
  3010. {
  3011. goto Cleanup;
  3012. }
  3013. for (int i = 0; ; i++)
  3014. {
  3015. cchKeyName = 256;
  3016. if (ERROR_SUCCESS != (ec = RegEnumKeyExW(hkeyVersions, i, verCurrent.wszKeyName, &cchKeyName, 0, NULL, NULL, NULL)))
  3017. {
  3018. if (ERROR_NO_MORE_ITEMS == ec)
  3019. {
  3020. break;
  3021. }
  3022. goto Cleanup;
  3023. }
  3024. if (!ParseVersion(&verCurrent))
  3025. {
  3026. continue; // invalid version syntax
  3027. }
  3028. if (verCurrent.dwComponent[0] > verHigh.dwComponent[0] ||
  3029. (verCurrent.dwComponent[0] == verHigh.dwComponent[0] && verCurrent.dwComponent[1] > verHigh.dwComponent[1]))
  3030. {
  3031. verHigh = verCurrent;
  3032. }
  3033. }
  3034. if (!verHigh.wszKeyName[0])
  3035. {
  3036. // ec must be ERROR_NO_MORE_ITEMS here
  3037. //
  3038. assert(ec == ERROR_NO_MORE_ITEMS);
  3039. // We will change the error code to ERROR_FILE_NOT_FOUND in order to indicate that
  3040. // LocalDB instalation is not found. Registry key "SOFTWARE\\Microsoft\\Microsoft SQL Server Local DB\\Installed Versions" exists
  3041. // but it is empty.
  3042. //
  3043. ec = ERROR_FILE_NOT_FOUND;
  3044. goto Cleanup;
  3045. }
  3046. if (ERROR_SUCCESS != (ec = RegOpenKeyExW(hkeyVersions, verHigh.wszKeyName, 0, KEY_READ, &hkeyVersion)))
  3047. {
  3048. goto Cleanup;
  3049. }
  3050. if (ERROR_SUCCESS != (ec = RegQueryValueExW(hkeyVersion, L"InstanceAPIPath", NULL, &dwValueType, (PBYTE) wszLocalDBDll, &cbLocalDBDll)))
  3051. {
  3052. goto Cleanup;
  3053. }
  3054. if (dwValueType != REG_SZ)
  3055. {
  3056. ec = ERROR_INVALID_DATA;
  3057. goto Cleanup;
  3058. }
  3059. // Ensure string value null-terminated
  3060. // Note that we left a spare character in the output buffer for RegQueryValueEx for this purpose
  3061. //
  3062. wszLocalDBDll[cbLocalDBDll/sizeof(WCHAR)] = L'\0';
  3063. hLocalDBDllTemp = LoadLibraryW(wszLocalDBDll);
  3064. if (NULL == hLocalDBDllTemp)
  3065. {
  3066. ec = GetLastError();
  3067. goto Cleanup;
  3068. }
  3069. if (NULL == InterlockedCompareExchangePointer((volatile PVOID *)&hLocalDBDll, hLocalDBDllTemp, NULL))
  3070. {
  3071. // We were the winner: we gave away our DLL handle
  3072. //
  3073. hLocalDBDllTemp = NULL;
  3074. }
  3075. ec = ERROR_SUCCESS;
  3076. Cleanup:
  3077. if (hLocalDBDllTemp)
  3078. FreeLibrary(hLocalDBDllTemp);
  3079. if (hkeyVersion)
  3080. RegCloseKey(hkeyVersion);
  3081. if (hkeyVersions)
  3082. RegCloseKey(hkeyVersions);
  3083. // Error code ERROR_FILE_NOT_FOUND can occure if registry hive with installed LocalDB versions is missing.
  3084. // In that case we should return the LocalDB specific error code
  3085. //
  3086. if (ec == ERROR_FILE_NOT_FOUND)
  3087. return LOCALDB_ERROR_NOT_INSTALLED;
  3088. if (ec != ERROR_SUCCESS)
  3089. return HRESULT_FROM_WIN32(ec);
  3090. }
  3091. FARPROC pfn = GetProcAddress(hLocalDBDll, szLocalDBFn);
  3092. if (!pfn)
  3093. {
  3094. return HRESULT_FROM_WIN32(GetLastError());
  3095. }
  3096. *pfnLocalDBFn = pfn;
  3097. return S_OK;
  3098. }
  3099. // The following proxy functions forward calls to the latest LocalDB API DLL.
  3100. //
  3101. HRESULT __cdecl
  3102. LocalDBCreateInstance (
  3103. // I the LocalDB version (e.g. 11.0 or 11.0.1094.2)
  3104. __in_z PCWSTR wszVersion,
  3105. // I the instance name
  3106. __in_z PCWSTR pInstanceName,
  3107. // I reserved for the future use. Currently should be set to 0.
  3108. __in DWORD dwFlags
  3109. )
  3110. {
  3111. LOCALDB_PROXY(LocalDBCreateInstance)(wszVersion, pInstanceName, dwFlags);
  3112. }
  3113. HRESULT __cdecl
  3114. LocalDBStartInstance(
  3115. // I the instance name
  3116. __in_z PCWSTR pInstanceName,
  3117. // I reserved for the future use. Currently should be set to 0.
  3118. __in DWORD dwFlags,
  3119. // O the buffer to store the connection string to the LocalDB instance
  3120. __out_ecount_z_opt(*lpcchSqlConnection) LPWSTR wszSqlConnection,
  3121. // I/O on input has the size of the wszSqlConnection buffer in characters. On output, if the given buffer size is
  3122. // too small, has the buffer size required, in characters, including trailing null.
  3123. __inout_opt LPDWORD lpcchSqlConnection
  3124. )
  3125. {
  3126. LOCALDB_PROXY(LocalDBStartInstance)(pInstanceName, dwFlags, wszSqlConnection, lpcchSqlConnection);
  3127. }
  3128. HRESULT __cdecl
  3129. LocalDBStopInstance (
  3130. // I the instance name
  3131. __in_z PCWSTR pInstanceName,
  3132. // I Available flags:
  3133. // LOCALDB_SHUTDOWN_KILL_PROCESS - force the instance to stop immediately
  3134. // LOCALDB_SHUTDOWN_WITH_NOWAIT - shutdown the instance with NOWAIT option
  3135. __in DWORD dwFlags,
  3136. // I the time in seconds to wait this operation to complete. If this value is 0, this function will return immediately
  3137. // without waiting for LocalDB instance to stop
  3138. __in ULONG ulTimeout
  3139. )
  3140. {
  3141. LOCALDB_PROXY(LocalDBStopInstance)(pInstanceName, dwFlags, ulTimeout);
  3142. }
  3143. HRESULT __cdecl
  3144. LocalDBDeleteInstance (
  3145. // I the instance name
  3146. __in_z PCWSTR pInstanceName,
  3147. // reserved for the future use. Currently should be set to 0.
  3148. __in DWORD dwFlags
  3149. )
  3150. {
  3151. LOCALDB_PROXY(LocalDBDeleteInstance)(pInstanceName, dwFlags);
  3152. }
  3153. HRESULT __cdecl
  3154. LocalDBFormatMessage(
  3155. // I the LocalDB error code
  3156. __in HRESULT hrLocalDB,
  3157. // I Available flags:
  3158. // LOCALDB_TRUNCATE_ERR_MESSAGE - if the input buffer is too short,
  3159. // the error message will be truncated to fit into the buffer
  3160. __in DWORD dwFlags,
  3161. // I Language desired (LCID) or 0 (in which case Win32 FormatMessage order is used)
  3162. __in DWORD dwLanguageId,
  3163. // O the buffer to store the LocalDB error message
  3164. __out_ecount_z(*lpcchMessage) LPWSTR wszMessage,
  3165. // I/O on input has the size of the wszMessage buffer in characters. On output, if the given buffer size is
  3166. // too small, has the buffer size required, in characters, including trailing null. If the function succeeds
  3167. // contains the number of characters in the message, excluding the trailing null
  3168. __inout LPDWORD lpcchMessage
  3169. )
  3170. {
  3171. LOCALDB_PROXY(LocalDBFormatMessage)(hrLocalDB, dwFlags, dwLanguageId, wszMessage, lpcchMessage);
  3172. }
  3173. HRESULT __cdecl
  3174. LocalDBGetInstances(
  3175. // O buffer with instance names
  3176. __out PTLocalDBInstanceName pInstanceNames,
  3177. // I/O on input has the number slots for instance names in the pInstanceNames buffer. On output,
  3178. // has the number of existing LocalDB instances
  3179. __inout LPDWORD lpdwNumberOfInstances
  3180. )
  3181. {
  3182. LOCALDB_PROXY(LocalDBGetInstances)(pInstanceNames, lpdwNumberOfInstances);
  3183. }
  3184. HRESULT __cdecl
  3185. LocalDBGetInstanceInfo(
  3186. // I the instance name
  3187. __in_z PCWSTR wszInstanceName,
  3188. // O instance information
  3189. __out PLocalDBInstanceInfo pInfo,
  3190. // I Size of LocalDBVersionInfo structure in bytes
  3191. __in DWORD cbInfo
  3192. )
  3193. {
  3194. LOCALDB_PROXY(LocalDBGetInstanceInfo)(wszInstanceName, pInfo, cbInfo);
  3195. }
  3196. HRESULT __cdecl
  3197. LocalDBStartTracing()
  3198. {
  3199. LOCALDB_PROXY(LocalDBStartTracing)();
  3200. }
  3201. HRESULT __cdecl
  3202. LocalDBStopTracing()
  3203. {
  3204. LOCALDB_PROXY(LocalDBStopTracing)();
  3205. }
  3206. HRESULT __cdecl
  3207. LocalDBShareInstance(
  3208. // I the SID of the LocalDB instance owner
  3209. __in_opt PSID pOwnerSID,
  3210. // I the private name of LocalDB instance which should be shared
  3211. __in_z PCWSTR wszLocalDBInstancePrivateName,
  3212. // I the public shared name
  3213. __in_z PCWSTR wszSharedName,
  3214. // I reserved for the future use. Currently should be set to 0.
  3215. __in DWORD dwFlags)
  3216. {
  3217. LOCALDB_PROXY(LocalDBShareInstance)(pOwnerSID, wszLocalDBInstancePrivateName, wszSharedName, dwFlags);
  3218. }
  3219. HRESULT __cdecl
  3220. LocalDBGetVersions(
  3221. // O buffer for installed LocalDB versions
  3222. __out PTLocalDBVersion pVersions,
  3223. // I/O on input has the number slots for versions in the pVersions buffer. On output,
  3224. // has the number of existing LocalDB versions
  3225. __inout LPDWORD lpdwNumberOfVersions
  3226. )
  3227. {
  3228. LOCALDB_PROXY(LocalDBGetVersions)(pVersions, lpdwNumberOfVersions);
  3229. }
  3230. HRESULT __cdecl
  3231. LocalDBUnshareInstance(
  3232. // I the LocalDB instance name
  3233. __in_z PCWSTR pInstanceName,
  3234. // I reserved for the future use. Currently should be set to 0.
  3235. __in DWORD dwFlags)
  3236. {
  3237. LOCALDB_PROXY(LocalDBUnshareInstance)(pInstanceName, dwFlags);
  3238. }
  3239. HRESULT __cdecl
  3240. LocalDBGetVersionInfo(
  3241. // I LocalDB version string
  3242. __in_z PCWSTR wszVersion,
  3243. // O version information
  3244. __out PLocalDBVersionInfo pVersionInfo,
  3245. // I Size of LocalDBVersionInfo structure in bytes
  3246. __in DWORD cbVersionInfo)
  3247. {
  3248. LOCALDB_PROXY(LocalDBGetVersionInfo)(wszVersion, pVersionInfo, cbVersionInfo);
  3249. }
  3250. HRESULT __cdecl
  3251. LocalDBGetSharedName(
  3252. // I the SID of the LocalDB instance owner
  3253. __in_opt PSID pOwnerSID,
  3254. // I the private name of LocalDB instance whose shared name should be returned
  3255. __in_z PCWSTR wszPrivateLocalDBInstanceName,
  3256. // O the shared name
  3257. __out_ecount_z_opt(MAX_LOCALDB_INSTANCE_NAME_LENGTH + 1) LPWSTR wszSharedName)
  3258. {
  3259. LOCALDB_PROXY(LocalDBGetSharedName)(pOwnerSID, wszPrivateLocalDBInstanceName, wszSharedName);
  3260. }
  3261. #endif
  3262. #endif // _SQLUSERINSTANCE_H_
  3263. //-----------------------------------------------------------------------------
  3264. // File: sqluserinstancemsgs.mc
  3265. //
  3266. // Copyright: Copyright (c) Microsoft Corporation
  3267. //-----------------------------------------------------------------------------
  3268. #ifndef _LOCALDB_MESSAGES_H_
  3269. #define _LOCALDB_MESSAGES_H_
  3270. // Header section
  3271. //
  3272. // Section with the LocalDB messages
  3273. //
  3274. //
  3275. // Values are 32 bit values laid out as follows:
  3276. //
  3277. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  3278. // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  3279. // +-+-+-+-+-+---------------------+-------------------------------+
  3280. // |S|R|C|N|r| Facility | Code |
  3281. // +-+-+-+-+-+---------------------+-------------------------------+
  3282. //
  3283. // where
  3284. //
  3285. // S - Severity - indicates success/fail
  3286. //
  3287. // 0 - Success
  3288. // 1 - Fail (COERROR)
  3289. //
  3290. // R - reserved portion of the facility code, corresponds to NT's
  3291. // second severity bit.
  3292. //
  3293. // C - reserved portion of the facility code, corresponds to NT's
  3294. // C field.
  3295. //
  3296. // N - reserved portion of the facility code. Used to indicate a
  3297. // mapped NT status value.
  3298. //
  3299. // r - reserved portion of the facility code. Reserved for internal
  3300. // use. Used to indicate HRESULT values that are not status
  3301. // values, but are instead message ids for display strings.
  3302. //
  3303. // Facility - is the facility code
  3304. //
  3305. // Code - is the facility's status code
  3306. //
  3307. //
  3308. // Define the facility codes
  3309. //
  3310. #define FACILITY_LOCALDB 0x9C5
  3311. //
  3312. // Define the severity codes
  3313. //
  3314. #define LOCALDB_SEVERITY_SUCCESS 0x0
  3315. #define LOCALDB_SEVERITY_ERROR 0x2
  3316. //
  3317. // MessageId: LOCALDB_ERROR_CANNOT_CREATE_INSTANCE_FOLDER
  3318. //
  3319. // MessageText:
  3320. //
  3321. // Cannot create folder for the Local Database instance at: %%LOCALAPPDATA%%\Microsoft\Microsoft SQL Server Local DB\Instances\<instance name>.
  3322. //
  3323. #define LOCALDB_ERROR_CANNOT_CREATE_INSTANCE_FOLDER ((HRESULT)0x89C50100L)
  3324. //
  3325. // MessageId: LOCALDB_ERROR_INVALID_PARAMETER
  3326. //
  3327. // MessageText:
  3328. //
  3329. // The parameter for the Local Database Instance API method is incorrect. Consult the API documentation.
  3330. //
  3331. #define LOCALDB_ERROR_INVALID_PARAMETER ((HRESULT)0x89C50101L)
  3332. //
  3333. // MessageId: LOCALDB_ERROR_INSTANCE_EXISTS_WITH_LOWER_VERSION
  3334. //
  3335. // MessageText:
  3336. //
  3337. // Unable to create the Local Database instance with specified version. An instance with the same name already exists, but it has lower version than the specified version.
  3338. //
  3339. #define LOCALDB_ERROR_INSTANCE_EXISTS_WITH_LOWER_VERSION ((HRESULT)0x89C50102L)
  3340. //
  3341. // MessageId: LOCALDB_ERROR_CANNOT_GET_USER_PROFILE_FOLDER
  3342. //
  3343. // MessageText:
  3344. //
  3345. // Cannot access the user profile folder for local application data (%%LOCALAPPDATA%%).
  3346. //
  3347. #define LOCALDB_ERROR_CANNOT_GET_USER_PROFILE_FOLDER ((HRESULT)0x89C50103L)
  3348. //
  3349. // MessageId: LOCALDB_ERROR_INSTANCE_FOLDER_PATH_TOO_LONG
  3350. //
  3351. // MessageText:
  3352. //
  3353. // The full path length of the Local Database instance folder is longer than MAX_PATH. The instance must be stored in folder:
  3354. // %%LOCALAPPDATA%%\Microsoft\Microsoft SQL Server Local DB\Instances\<instance name>.
  3355. //
  3356. #define LOCALDB_ERROR_INSTANCE_FOLDER_PATH_TOO_LONG ((HRESULT)0x89C50104L)
  3357. //
  3358. // MessageId: LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_FOLDER
  3359. //
  3360. // MessageText:
  3361. //
  3362. // Cannot access Local Database instance folder: %%LOCALAPPDATA%%\Microsoft\Microsoft SQL Server Local DB\Instances\<instance name>.
  3363. //
  3364. #define LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_FOLDER ((HRESULT)0x89C50105L)
  3365. //
  3366. // MessageId: LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_REGISTRY
  3367. //
  3368. // MessageText:
  3369. //
  3370. // Unexpected error occurred while trying to access the Local Database instance registry configuration. See the Windows Application event log for error details.
  3371. //
  3372. #define LOCALDB_ERROR_CANNOT_ACCESS_INSTANCE_REGISTRY ((HRESULT)0x89C50106L)
  3373. //
  3374. // MessageId: LOCALDB_ERROR_UNKNOWN_INSTANCE
  3375. //
  3376. // MessageText:
  3377. //
  3378. // The specified Local Database instance does not exist.
  3379. //
  3380. #define LOCALDB_ERROR_UNKNOWN_INSTANCE ((HRESULT)0x89C50107L)
  3381. //
  3382. // MessageId: LOCALDB_ERROR_INTERNAL_ERROR
  3383. //
  3384. // MessageText:
  3385. //
  3386. // Unexpected error occurred inside a Local Database instance API method call. See the Windows Application event log for error details.
  3387. //
  3388. #define LOCALDB_ERROR_INTERNAL_ERROR ((HRESULT)0x89C50108L)
  3389. //
  3390. // MessageId: LOCALDB_ERROR_CANNOT_MODIFY_INSTANCE_REGISTRY
  3391. //
  3392. // MessageText:
  3393. //
  3394. // Unexpected error occurred while trying to modify the registry configuration for the Local Database instance. See the Windows Application event log for error details.
  3395. //
  3396. #define LOCALDB_ERROR_CANNOT_MODIFY_INSTANCE_REGISTRY ((HRESULT)0x89C50109L)
  3397. //
  3398. // MessageId: LOCALDB_ERROR_SQL_SERVER_STARTUP_FAILED
  3399. //
  3400. // MessageText:
  3401. //
  3402. // Error occurred during Local Database instance startup: SQL Server process failed to start.
  3403. //
  3404. #define LOCALDB_ERROR_SQL_SERVER_STARTUP_FAILED ((HRESULT)0x89C5010AL)
  3405. //
  3406. // MessageId: LOCALDB_ERROR_INSTANCE_CONFIGURATION_CORRUPT
  3407. //
  3408. // MessageText:
  3409. //
  3410. // Local Database instance is corrupted. See the Windows Application event log for error details.
  3411. //
  3412. #define LOCALDB_ERROR_INSTANCE_CONFIGURATION_CORRUPT ((HRESULT)0x89C5010BL)
  3413. //
  3414. // MessageId: LOCALDB_ERROR_CANNOT_CREATE_SQL_PROCESS
  3415. //
  3416. // MessageText:
  3417. //
  3418. // Error occurred during Local Database instance startup: unable to create the SQL Server process.
  3419. //
  3420. #define LOCALDB_ERROR_CANNOT_CREATE_SQL_PROCESS ((HRESULT)0x89C5010CL)
  3421. //
  3422. // MessageId: LOCALDB_ERROR_UNKNOWN_VERSION
  3423. //
  3424. // MessageText:
  3425. //
  3426. // The specified Local Database version is not available on this computer.
  3427. //
  3428. #define LOCALDB_ERROR_UNKNOWN_VERSION ((HRESULT)0x89C5010DL)
  3429. //
  3430. // MessageId: LOCALDB_ERROR_UNKNOWN_LANGUAGE_ID
  3431. //
  3432. // MessageText:
  3433. //
  3434. // Error getting the localized error message. The language specified by 'Language ID' parameter is unknown.
  3435. //
  3436. #define LOCALDB_ERROR_UNKNOWN_LANGUAGE_ID ((HRESULT)0x89C5010EL)
  3437. //
  3438. // MessageId: LOCALDB_ERROR_INSTANCE_STOP_FAILED
  3439. //
  3440. // MessageText:
  3441. //
  3442. // Stop operation for Local Database instance failed to complete within the specified time.
  3443. //
  3444. #define LOCALDB_ERROR_INSTANCE_STOP_FAILED ((HRESULT)0x89C5010FL)
  3445. //
  3446. // MessageId: LOCALDB_ERROR_UNKNOWN_ERROR_CODE
  3447. //
  3448. // MessageText:
  3449. //
  3450. // Error getting the localized error message. The specified error code is unknown.
  3451. //
  3452. #define LOCALDB_ERROR_UNKNOWN_ERROR_CODE ((HRESULT)0x89C50110L)
  3453. //
  3454. // MessageId: LOCALDB_ERROR_VERSION_REQUESTED_NOT_INSTALLED
  3455. //
  3456. // MessageText:
  3457. //
  3458. // The Local Database version available on this workstation is lower than the requested Local Database version.
  3459. //
  3460. #define LOCALDB_ERROR_VERSION_REQUESTED_NOT_INSTALLED ((HRESULT)0x89C50111L)
  3461. //
  3462. // MessageId: LOCALDB_ERROR_INSTANCE_BUSY
  3463. //
  3464. // MessageText:
  3465. //
  3466. // Requested operation on Local Database instance cannot be performed because specified instance is currently in use. Stop the instance and try again.
  3467. //
  3468. #define LOCALDB_ERROR_INSTANCE_BUSY ((HRESULT)0x89C50112L)
  3469. //
  3470. // MessageId: LOCALDB_ERROR_INVALID_OPERATION
  3471. //
  3472. // MessageText:
  3473. //
  3474. // Default Local Database instances cannot be created, stopped or deleted manually.
  3475. //
  3476. #define LOCALDB_ERROR_INVALID_OPERATION ((HRESULT)0x89C50113L)
  3477. //
  3478. // MessageId: LOCALDB_ERROR_INSUFFICIENT_BUFFER
  3479. //
  3480. // MessageText:
  3481. //
  3482. // The buffer passed to the Local Database instance API method has insufficient size.
  3483. //
  3484. #define LOCALDB_ERROR_INSUFFICIENT_BUFFER ((HRESULT)0x89C50114L)
  3485. //
  3486. // MessageId: LOCALDB_ERROR_WAIT_TIMEOUT
  3487. //
  3488. // MessageText:
  3489. //
  3490. // Timeout occurred inside the Local Database instance API method.
  3491. //
  3492. #define LOCALDB_ERROR_WAIT_TIMEOUT ((HRESULT)0x89C50115L)
  3493. // MessageId=0x0116 message id is reserved. This message ID will be used for error LOCALDB_ERROR_NOT_INSTALLED.
  3494. // This message is specific since it has to be present in SqlUserIntsnace.h because it can be returned by discovery API.
  3495. //
  3496. //
  3497. // MessageId: LOCALDB_ERROR_XEVENT_FAILED
  3498. //
  3499. // MessageText:
  3500. //
  3501. // Failed to start XEvent engine within the Local Database Instance API.
  3502. //
  3503. #define LOCALDB_ERROR_XEVENT_FAILED ((HRESULT)0x89C50117L)
  3504. //
  3505. // MessageId: LOCALDB_ERROR_AUTO_INSTANCE_CREATE_FAILED
  3506. //
  3507. // MessageText:
  3508. //
  3509. // Cannot create an automatic instance. See the Windows Application event log for error details.
  3510. //
  3511. #define LOCALDB_ERROR_AUTO_INSTANCE_CREATE_FAILED ((HRESULT)0x89C50118L)
  3512. //
  3513. // MessageId: LOCALDB_ERROR_SHARED_NAME_TAKEN
  3514. //
  3515. // MessageText:
  3516. //
  3517. // Cannot create a shared instance. The specified shared instance name is already in use.
  3518. //
  3519. #define LOCALDB_ERROR_SHARED_NAME_TAKEN ((HRESULT)0x89C50119L)
  3520. //
  3521. // MessageId: LOCALDB_ERROR_CALLER_IS_NOT_OWNER
  3522. //
  3523. // MessageText:
  3524. //
  3525. // API caller is not Local Database instance owner.
  3526. //
  3527. #define LOCALDB_ERROR_CALLER_IS_NOT_OWNER ((HRESULT)0x89C5011AL)
  3528. //
  3529. // MessageId: LOCALDB_ERROR_INVALID_INSTANCE_NAME
  3530. //
  3531. // MessageText:
  3532. //
  3533. // Specified Local Database instance name is invalid.
  3534. //
  3535. #define LOCALDB_ERROR_INVALID_INSTANCE_NAME ((HRESULT)0x89C5011BL)
  3536. //
  3537. // MessageId: LOCALDB_ERROR_INSTANCE_ALREADY_SHARED
  3538. //
  3539. // MessageText:
  3540. //
  3541. // The specified Local Database instance is already shared with different shared name.
  3542. //
  3543. #define LOCALDB_ERROR_INSTANCE_ALREADY_SHARED ((HRESULT)0x89C5011CL)
  3544. //
  3545. // MessageId: LOCALDB_ERROR_INSTANCE_NOT_SHARED
  3546. //
  3547. // MessageText:
  3548. //
  3549. // The specified Local Database instance is not shared.
  3550. //
  3551. #define LOCALDB_ERROR_INSTANCE_NOT_SHARED ((HRESULT)0x89C5011DL)
  3552. //
  3553. // MessageId: LOCALDB_ERROR_ADMIN_RIGHTS_REQUIRED
  3554. //
  3555. // MessageText:
  3556. //
  3557. // Administrator privileges are required in order to execute this operation.
  3558. //
  3559. #define LOCALDB_ERROR_ADMIN_RIGHTS_REQUIRED ((HRESULT)0x89C5011EL)
  3560. //
  3561. // MessageId: LOCALDB_ERROR_TOO_MANY_SHARED_INSTANCES
  3562. //
  3563. // MessageText:
  3564. //
  3565. // There are too many shared instance and we cannot generate unique User Instance Name.
  3566. // Unshare some of the existing shared instances.
  3567. //
  3568. #define LOCALDB_ERROR_TOO_MANY_SHARED_INSTANCES ((HRESULT)0x89C5011FL)
  3569. // Detailed error descriptions
  3570. //
  3571. // MessageId: LOCALDB_EDETAIL_DATADIRECTORY_IS_MISSING
  3572. //
  3573. // MessageText:
  3574. //
  3575. // The "DataDirectory" registry value is missing in the Local Database instance registry key: %1
  3576. //
  3577. #define LOCALDB_EDETAIL_DATADIRECTORY_IS_MISSING ((HRESULT)0x89C50200L)
  3578. //
  3579. // MessageId: LOCALDB_EDETAIL_CANNOT_ACCESS_INSTANCE_FOLDER
  3580. //
  3581. // MessageText:
  3582. //
  3583. // Cannot access Local Database instance folder: %1
  3584. //
  3585. #define LOCALDB_EDETAIL_CANNOT_ACCESS_INSTANCE_FOLDER ((HRESULT)0x89C50201L)
  3586. //
  3587. // MessageId: LOCALDB_EDETAIL_DATADIRECTORY_IS_TOO_LONG
  3588. //
  3589. // MessageText:
  3590. //
  3591. // The "DataDirectory" registry value is too long in the Local Database instance registry key: %1
  3592. //
  3593. #define LOCALDB_EDETAIL_DATADIRECTORY_IS_TOO_LONG ((HRESULT)0x89C50202L)
  3594. //
  3595. // MessageId: LOCALDB_EDETAIL_PARENT_INSTANCE_IS_MISSING
  3596. //
  3597. // MessageText:
  3598. //
  3599. // The "Parent Instance" registry value is missing in the Local Database instance registry key: %1
  3600. //
  3601. #define LOCALDB_EDETAIL_PARENT_INSTANCE_IS_MISSING ((HRESULT)0x89C50203L)
  3602. //
  3603. // MessageId: LOCALDB_EDETAIL_PARENT_INSTANCE_IS_TOO_LONG
  3604. //
  3605. // MessageText:
  3606. //
  3607. // The "Parent Instance" registry value is too long in the Local Database instance registry key: %1
  3608. //
  3609. #define LOCALDB_EDETAIL_PARENT_INSTANCE_IS_TOO_LONG ((HRESULT)0x89C50204L)
  3610. //
  3611. // MessageId: LOCALDB_EDETAIL_DATA_DIRECTORY_INVALID
  3612. //
  3613. // MessageText:
  3614. //
  3615. // Data directory for Local Database instance is invalid: %1
  3616. //
  3617. #define LOCALDB_EDETAIL_DATA_DIRECTORY_INVALID ((HRESULT)0x89C50205L)
  3618. //
  3619. // MessageId: LOCALDB_EDETAIL_XEVENT_ASSERT
  3620. //
  3621. // MessageText:
  3622. //
  3623. // Local Database instance API: XEvent engine assert: %1 in %2:%3 (%4)
  3624. //
  3625. #define LOCALDB_EDETAIL_XEVENT_ASSERT ((HRESULT)0x89C50206L)
  3626. //
  3627. // MessageId: LOCALDB_EDETAIL_XEVENT_ERROR
  3628. //
  3629. // MessageText:
  3630. //
  3631. // Local Database instance API: XEvent error: %1
  3632. //
  3633. #define LOCALDB_EDETAIL_XEVENT_ERROR ((HRESULT)0x89C50207L)
  3634. //
  3635. // MessageId: LOCALDB_EDETAIL_INSTALLATION_CORRUPTED
  3636. //
  3637. // MessageText:
  3638. //
  3639. // Local Database installation is corrupted. Reinstall the Local Database.
  3640. //
  3641. #define LOCALDB_EDETAIL_INSTALLATION_CORRUPTED ((HRESULT)0x89C50208L)
  3642. //
  3643. // MessageId: LOCALDB_EDETAIL_CANNOT_GET_PROGRAM_FILES_LOCATION
  3644. //
  3645. // MessageText:
  3646. //
  3647. // Local Database XEvent error: cannot determine %ProgramFiles% folder location.
  3648. //
  3649. #define LOCALDB_EDETAIL_CANNOT_GET_PROGRAM_FILES_LOCATION ((HRESULT)0x89C50209L)
  3650. //
  3651. // MessageId: LOCALDB_EDETAIL_XEVENT_CANNOT_INITIALIZE
  3652. //
  3653. // MessageText:
  3654. //
  3655. // Local Database XEvent error: Cannot initialize XEvent engine.
  3656. //
  3657. #define LOCALDB_EDETAIL_XEVENT_CANNOT_INITIALIZE ((HRESULT)0x89C5020AL)
  3658. //
  3659. // MessageId: LOCALDB_EDETAIL_XEVENT_CANNOT_FIND_CONF_FILE
  3660. //
  3661. // MessageText:
  3662. //
  3663. // Local Database XEvent error: Cannot find XEvents configuration file: %1
  3664. //
  3665. #define LOCALDB_EDETAIL_XEVENT_CANNOT_FIND_CONF_FILE ((HRESULT)0x89C5020BL)
  3666. //
  3667. // MessageId: LOCALDB_EDETAIL_XEVENT_CANNOT_CONFIGURE
  3668. //
  3669. // MessageText:
  3670. //
  3671. // Local Database XEvent error: Cannot configure XEvents engine with the configuration file: %1
  3672. // HRESULT returned: %2
  3673. //
  3674. #define LOCALDB_EDETAIL_XEVENT_CANNOT_CONFIGURE ((HRESULT)0x89C5020CL)
  3675. //
  3676. // MessageId: LOCALDB_EDETAIL_XEVENT_CONF_FILE_NAME_TOO_LONG
  3677. //
  3678. // MessageText:
  3679. //
  3680. // Local Database XEvent error: XEvents engine configuration file too long
  3681. //
  3682. #define LOCALDB_EDETAIL_XEVENT_CONF_FILE_NAME_TOO_LONG ((HRESULT)0x89C5020DL)
  3683. //
  3684. // MessageId: LOCALDB_EDETAIL_COINITIALIZEEX_FAILED
  3685. //
  3686. // MessageText:
  3687. //
  3688. // CoInitializeEx API failed. HRESULT returned: %1
  3689. //
  3690. #define LOCALDB_EDETAIL_COINITIALIZEEX_FAILED ((HRESULT)0x89C5020EL)
  3691. //
  3692. // MessageId: LOCALDB_EDETAIL_PARENT_INSTANCE_VERSION_INVALID
  3693. //
  3694. // MessageText:
  3695. //
  3696. // Local Database parent instance version is invalid: %1
  3697. //
  3698. #define LOCALDB_EDETAIL_PARENT_INSTANCE_VERSION_INVALID ((HRESULT)0x89C5020FL)
  3699. // The following section are the message definitions. Those messages will be used for logging in the Windows Application event log.
  3700. //
  3701. // MessageId: LOCALDB_EDETAIL_WINAPI_ERROR
  3702. //
  3703. // MessageText:
  3704. //
  3705. // Windows API call %1 returned error code: %2. Windows system error message is: %3Reported at line: %4. %5
  3706. //
  3707. #define LOCALDB_EDETAIL_WINAPI_ERROR ((DWORD)0xC9C50500L)
  3708. //
  3709. #endif
  3710. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0011_v0_0_c_ifspec;
  3711. extern RPC_IF_HANDLE __MIDL_itf_sqlncli_0000_0011_v0_0_s_ifspec;
  3712. /* Additional Prototypes for ALL interfaces */
  3713. /* end of Additional Prototypes */
  3714. #ifdef __cplusplus
  3715. }
  3716. #endif
  3717. #endif