Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3785 lines
146 KiB

  1. #ifndef _USE_OLD_JET_H_
  2. #define _USE_NEW_JET_H_ /* The USE_NEW_JET_H is needed for err.awk to generate err.c in cli */
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif
  6. // *******************************************************************************
  7. // New Jet header...
  8. // *******************************************************************************
  9. #if !defined(_JET_INCLUDED)
  10. #define _JET_INCLUDED
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define JET_cbPage 4096 // UNDONE: Remove when no more components reference this.
  15. #if defined(_M_ALPHA)
  16. #include <pshpack8.h>
  17. #else
  18. #include <pshpack4.h>
  19. #endif
  20. #define JET_API __stdcall
  21. #define JET_NODSAPI __stdcall
  22. typedef long JET_ERR;
  23. typedef unsigned long JET_INSTANCE; /* Instance Identifier */
  24. typedef ULONG_PTR JET_SESID; /* Session Identifier */
  25. typedef ULONG_PTR JET_TABLEID; /* Table Identifier */
  26. typedef unsigned long JET_COLUMNID; /* Column Identifier */
  27. typedef ULONG_PTR JET_DBID; /* Database Identifier */
  28. typedef unsigned long JET_OBJTYP; /* Object Type */
  29. typedef unsigned long JET_COLTYP; /* Column Type */
  30. typedef unsigned long JET_GRBIT; /* Group of Bits */
  31. typedef unsigned long JET_SNP; /* Status Notification Process */
  32. typedef unsigned long JET_SNT; /* Status Notification Type */
  33. typedef unsigned long JET_SNC; /* Status Notification Code */
  34. typedef double JET_DATESERIAL; /* JET_coltypDateTime format */
  35. typedef unsigned long JET_HANDLE; /* backup file handle */
  36. typedef JET_ERR (__stdcall *JET_PFNSTATUS)(JET_SESID sesid, JET_SNP snp, JET_SNT snt, void *pv);
  37. /* required for Exchange to make RSTMAP RPC capable
  38. /**/
  39. #ifdef MIDL_PASS
  40. #define xRPC_STRING [string]
  41. #else
  42. #define xRPC_STRING
  43. typedef unsigned short WCHAR;
  44. #endif
  45. typedef struct
  46. {
  47. xRPC_STRING char *szDatabaseName;
  48. xRPC_STRING char *szNewDatabaseName;
  49. } JET_RSTMAP; /* restore map */
  50. /* required for Exchange unicode support
  51. /**/
  52. #define UNICODE_RSTMAP
  53. typedef struct tagJET_RSTMAPW {
  54. xRPC_STRING WCHAR *wszDatabaseName;
  55. xRPC_STRING WCHAR *wszNewDatabaseName;
  56. } JET_RSTMAPW, *PJET_RSTMAPW;
  57. // For edbutil convert only.
  58. typedef struct tagCONVERT
  59. {
  60. char *szOldDll;
  61. union
  62. {
  63. unsigned long fFlags;
  64. struct
  65. {
  66. unsigned long fSchemaChangesOnly:1;
  67. };
  68. };
  69. } JET_CONVERT;
  70. typedef enum
  71. {
  72. opDBUTILConsistency,
  73. opDBUTILDumpData,
  74. opDBUTILDumpMetaData,
  75. opDBUTILDumpPage,
  76. opDBUTILDumpNode,
  77. opDBUTILDumpSpace,
  78. opDBUTILSetHeaderState,
  79. opDBUTILDumpHeader,
  80. opDBUTILDumpLogfile,
  81. opDBUTILDumpLogfileTrackNode,
  82. opDBUTILDumpCheckpoint,
  83. opDBUTILEDBDump,
  84. opDBUTILEDBRepair,
  85. opDBUTILMunge
  86. } DBUTIL_OP;
  87. typedef enum
  88. {
  89. opEDBDumpTables,
  90. opEDBDumpIndexes,
  91. opEDBDumpColumns,
  92. opEDBDumpPage,
  93. } EDBDUMP_OP;
  94. typedef struct tagDBUTIL
  95. {
  96. unsigned long cbStruct;
  97. JET_SESID sesid;
  98. JET_DBID dbid;
  99. JET_TABLEID tableid;
  100. DBUTIL_OP op;
  101. EDBDUMP_OP edbdump;
  102. JET_GRBIT grbitOptions;
  103. char *szDatabase;
  104. char *szBackup;
  105. char *szTable;
  106. char *szIndex;
  107. long pgno;
  108. long iline;
  109. long lGeneration;
  110. long isec;
  111. long ib;
  112. long cRetry;
  113. void * pfnCallback;
  114. void * pvCallback;
  115. } JET_DBUTIL;
  116. #define JET_bitDBUtilOptionAllNodes 0x00000001
  117. #define JET_bitDBUtilOptionKeyStats 0x00000002
  118. #define JET_bitDBUtilOptionPageDump 0x00000004
  119. #define JET_bitDBUtilOptionDumpVerbose 0x10000000 // DEBUG only
  120. #define JET_bitDBUtilOptionCheckBTree 0x20000000 // DEBUG only
  121. #define JET_bitDBUtilOptionStats 0x00000008
  122. #define JET_bitDBUtilOptionVerbose 0x00000010
  123. #define JET_bitDBUtilOptionIgnoreErrors 0x00000020
  124. #define JET_bitDBUtilOptionVerify 0x00000040
  125. #define JET_bitDBUtilOptionReportErrors 0x00000080
  126. #define JET_bitDBUtilOptionDontRepair 0x00000100
  127. #define JET_bitDBUtilOptionRepairAll 0x00000200
  128. #define JET_bitDBUtilOptionRepairIndexes 0x00000400
  129. #define JET_bitDBUtilOptionDontBuildIndexes 0x00000800
  130. // Online defragmentation options
  131. #define JET_bitDefragmentBatchStart 0x00000001
  132. #define JET_bitDefragmentBatchStop 0x00000002
  133. /* Session information bits */
  134. #define JET_bitCIMCommitted 0x00000001
  135. #define JET_bitCIMDirty 0x00000002
  136. #define JET_bitAggregateTransaction 0x00000008
  137. /* Status Notification Structures */
  138. typedef struct /* Status Notification Progress */
  139. {
  140. unsigned long cbStruct; /* Size of this structure */
  141. unsigned long cunitDone; /* Number of units of work completed */
  142. unsigned long cunitTotal; /* Total number of units of work */
  143. } JET_SNPROG;
  144. typedef struct /* Status Notification Message */
  145. {
  146. unsigned long cbStruct; /* Size of this structure */
  147. JET_SNC snc; /* Status Notification Code */
  148. unsigned long ul; /* Numeric identifier */
  149. char sz[256]; /* Identifier */
  150. } JET_SNMSG;
  151. typedef struct
  152. {
  153. unsigned long cbStruct;
  154. unsigned long cbFilesizeLow; // file's current size (low DWORD)
  155. unsigned long cbFilesizeHigh; // file's current size (high DWORD)
  156. unsigned long cbFreeSpaceRequiredLow; // estimate of free disk space required for in-place upgrade (low DWORD)
  157. unsigned long cbFreeSpaceRequiredHigh;// estimate of free disk space required for in-place upgrade (high DWORD)
  158. unsigned long csecToUpgrade; // estimate of time required, in seconds, for upgrade
  159. union
  160. {
  161. unsigned long ulFlags;
  162. struct
  163. {
  164. unsigned long fUpgradable:1;
  165. unsigned long fAlreadyUpgraded:1;
  166. };
  167. };
  168. } JET_DBINFOUPGRADE;
  169. typedef struct
  170. {
  171. unsigned long cbStruct;
  172. JET_OBJTYP objtyp;
  173. JET_DATESERIAL dtCreate; // XXX -- to be deleted
  174. JET_DATESERIAL dtUpdate; // XXX -- to be deleted
  175. JET_GRBIT grbit;
  176. unsigned long flags;
  177. unsigned long cRecord;
  178. unsigned long cPage;
  179. } JET_OBJECTINFO;
  180. /* The following flags appear in the grbit field above */
  181. #define JET_bitTableInfoUpdatable 0x00000001
  182. #define JET_bitTableInfoBookmark 0x00000002
  183. #define JET_bitTableInfoRollback 0x00000004
  184. #define JET_bitTableSequential 0x00008000
  185. /* The following flags occur in the flags field above */
  186. #define JET_bitObjectSystem 0x80000000 // Internal use only
  187. #define JET_bitObjectTableFixedDDL 0x40000000 // Table's DDL is fixed
  188. #define JET_bitObjectTableTemplate 0x20000000 // Table's DDL is inheritable (implies FixedDDL)
  189. #define JET_bitObjectTableDerived 0x10000000 // Table's DDL is inherited from a template table
  190. #define JET_bitObjectSystemDynamic (JET_bitObjectSystem|0x08000000) // Internal use only (dynamic system objects)
  191. typedef struct
  192. {
  193. unsigned long cbStruct;
  194. JET_TABLEID tableid;
  195. unsigned long cRecord;
  196. JET_COLUMNID columnidcontainername;
  197. JET_COLUMNID columnidobjectname;
  198. JET_COLUMNID columnidobjtyp;
  199. JET_COLUMNID columniddtCreate; // XXX -- to be deleted
  200. JET_COLUMNID columniddtUpdate; // XXX -- to be deleted
  201. JET_COLUMNID columnidgrbit;
  202. JET_COLUMNID columnidflags;
  203. JET_COLUMNID columnidcRecord; /* Level 2 info */
  204. JET_COLUMNID columnidcPage; /* Level 2 info */
  205. } JET_OBJECTLIST;
  206. #define cObjectInfoCols 9
  207. typedef struct
  208. {
  209. unsigned long cbStruct;
  210. JET_TABLEID tableid;
  211. unsigned long cRecord;
  212. JET_COLUMNID columnidPresentationOrder;
  213. JET_COLUMNID columnidcolumnname;
  214. JET_COLUMNID columnidcolumnid;
  215. JET_COLUMNID columnidcoltyp;
  216. JET_COLUMNID columnidCountry;
  217. JET_COLUMNID columnidLangid;
  218. JET_COLUMNID columnidCp;
  219. JET_COLUMNID columnidCollate;
  220. JET_COLUMNID columnidcbMax;
  221. JET_COLUMNID columnidgrbit;
  222. JET_COLUMNID columnidDefault;
  223. JET_COLUMNID columnidBaseTableName;
  224. JET_COLUMNID columnidBaseColumnName;
  225. JET_COLUMNID columnidDefinitionName;
  226. } JET_COLUMNLIST;
  227. #define cColumnInfoCols 14
  228. typedef struct
  229. {
  230. unsigned long cbStruct;
  231. JET_COLUMNID columnid;
  232. JET_COLTYP coltyp;
  233. unsigned short wCountry;
  234. unsigned short langid;
  235. unsigned short cp;
  236. unsigned short wCollate; /* Must be 0 */
  237. unsigned long cbMax;
  238. JET_GRBIT grbit;
  239. } JET_COLUMNDEF;
  240. typedef struct
  241. {
  242. unsigned long cbStruct;
  243. JET_COLUMNID columnid;
  244. JET_COLTYP coltyp;
  245. unsigned short wCountry;
  246. unsigned short langid;
  247. unsigned short cp;
  248. unsigned short wFiller; /* Must be 0 */
  249. unsigned long cbMax;
  250. JET_GRBIT grbit;
  251. char szBaseTableName[256];
  252. char szBaseColumnName[256];
  253. } JET_COLUMNBASE;
  254. typedef struct
  255. {
  256. unsigned long cbStruct;
  257. JET_TABLEID tableid;
  258. unsigned long cRecord;
  259. JET_COLUMNID columnidindexname;
  260. JET_COLUMNID columnidgrbitIndex;
  261. JET_COLUMNID columnidcKey;
  262. JET_COLUMNID columnidcEntry;
  263. JET_COLUMNID columnidcPage;
  264. JET_COLUMNID columnidcColumn;
  265. JET_COLUMNID columnidiColumn;
  266. JET_COLUMNID columnidcolumnid;
  267. JET_COLUMNID columnidcoltyp;
  268. JET_COLUMNID columnidCountry;
  269. JET_COLUMNID columnidLangid;
  270. JET_COLUMNID columnidCp;
  271. JET_COLUMNID columnidCollate;
  272. JET_COLUMNID columnidgrbitColumn;
  273. JET_COLUMNID columnidcolumnname;
  274. } JET_INDEXLIST;
  275. #define cIndexInfoCols 15
  276. typedef struct tag_JET_COLUMNCREATE
  277. {
  278. unsigned long cbStruct; // size of this structure (for future expansion)
  279. char *szColumnName; // column name
  280. JET_COLTYP coltyp; // column type
  281. unsigned long cbMax; // the maximum length of this column (only relevant for binary and text columns)
  282. JET_GRBIT grbit; // column options
  283. void *pvDefault; // default value (NULL if none)
  284. unsigned long cbDefault; // length of default value
  285. unsigned long cp; // code page (for text columns only)
  286. JET_COLUMNID columnid; // returned column id
  287. JET_ERR err; // returned error code
  288. } JET_COLUMNCREATE;
  289. typedef struct tagJET_INDEXCREATEOLD // [4/15/97]: to be phased out eventually (laurionb)
  290. {
  291. unsigned long cbStruct; // size of this structure (for future expansion)
  292. char *szIndexName; // index name
  293. char *szKey; // index key
  294. unsigned long cbKey; // length of key
  295. JET_GRBIT grbit; // index options
  296. unsigned long ulDensity; // index density
  297. JET_ERR err; // returned error code
  298. } JET_INDEXCREATEOLD;
  299. typedef struct tagJET_CONDITIONALCOLUMN
  300. {
  301. unsigned long cbStruct; // size of this structure (for future expansion)
  302. char *szColumnName; // column that we are conditionally indexed on
  303. JET_GRBIT grbit; // conditional column options
  304. } JET_CONDITIONALCOLUMN;
  305. typedef struct tagJET_INDEXCREATE
  306. {
  307. unsigned long cbStruct; // size of this structure (for future expansion)
  308. char *szIndexName; // index name
  309. char *szKey; // index key
  310. unsigned long cbKey; // length of key
  311. JET_GRBIT grbit; // index options
  312. unsigned long ulDensity; // index density
  313. unsigned long lcid; // lcid for the index
  314. unsigned long cbVarSegMac; // maximum length of variable length columns in index key
  315. JET_CONDITIONALCOLUMN * rgconditionalcolumn; // pointer to conditional column structure
  316. unsigned long cConditionalColumn; // number of conditional columns
  317. JET_ERR err; // returned error code
  318. } JET_INDEXCREATE;
  319. typedef struct tagJET_TABLECREATE
  320. {
  321. unsigned long cbStruct; // size of this structure (for future expansion)
  322. char *szTableName; // name of table to create.
  323. char *szTemplateTableName; // name of table from which to inherit base DDL
  324. unsigned long ulPages; // initial pages to allocate for table.
  325. unsigned long ulDensity; // table density.
  326. JET_COLUMNCREATE *rgcolumncreate; // array of column creation info
  327. unsigned long cColumns; // number of columns to create
  328. JET_INDEXCREATE *rgindexcreate; // array of index creation info
  329. unsigned long cIndexes; // number of indexes to create
  330. JET_GRBIT grbit;
  331. JET_TABLEID tableid; // returned tableid.
  332. unsigned long cCreated; // count of objects created (columns+table+indexes).
  333. } JET_TABLECREATE;
  334. typedef struct
  335. {
  336. unsigned long cbStruct;
  337. unsigned long ibLongValue;
  338. unsigned long itagSequence;
  339. JET_COLUMNID columnidNextTagged;
  340. } JET_RETINFO;
  341. typedef struct
  342. {
  343. unsigned long cbStruct;
  344. unsigned long ibLongValue;
  345. unsigned long itagSequence;
  346. } JET_SETINFO;
  347. typedef struct
  348. {
  349. unsigned long cbStruct;
  350. unsigned long centriesLT;
  351. unsigned long centriesInRange;
  352. unsigned long centriesTotal;
  353. } JET_RECPOS;
  354. // The caller need to setup JET_OLP with a signal wait for the signal to be set.
  355. typedef struct {
  356. void *pvReserved1; // internally use
  357. void *pvReserved2;
  358. unsigned long cbActual; // the actual number of bytes read through this IO
  359. JET_HANDLE hSig; // a manual reset signal to wait for the IO to complete.
  360. JET_ERR err; // Err code for this assync IO.
  361. } JET_OLP;
  362. #include <pshpack1.h>
  363. #define JET_MAX_COMPUTERNAME_LENGTH 15
  364. typedef struct {
  365. char bSeconds; // 0 - 60
  366. char bMinutes; // 0 - 60
  367. char bHours; // 0 - 24
  368. char bDay; // 1 - 31
  369. char bMonth; // 0 - 11
  370. char bYear; // current year - 1900
  371. char bFiller1;
  372. char bFiller2;
  373. } JET_LOGTIME;
  374. typedef struct
  375. {
  376. unsigned short ib; // must be the last so that lgpos can
  377. unsigned short isec; // index of disksec starting logsec
  378. long lGeneration; // generation of logsec
  379. } JET_LGPOS; // be casted to TIME.
  380. typedef struct
  381. {
  382. unsigned long ulRandom; // a random number
  383. JET_LOGTIME logtimeCreate; // time db created, in logtime format
  384. char szComputerName[ JET_MAX_COMPUTERNAME_LENGTH + 1 ]; // where db is created
  385. } JET_SIGNATURE;
  386. typedef struct
  387. {
  388. JET_LGPOS lgposMark; // id for this backup
  389. JET_LOGTIME logtimeMark;
  390. unsigned long genLow;
  391. unsigned long genHigh;
  392. } JET_BKINFO;
  393. #include <poppack.h>
  394. typedef struct {
  395. unsigned long ulVersion; // version of DAE the db created (see ulDAEVersion)
  396. unsigned long ulUpdate; // used to track incremental database format updates that
  397. // are backward-compatible (see ulDAEUpdate)
  398. JET_SIGNATURE signDb; // (28 bytes) signature of the db (incl. creation time).
  399. unsigned long dbstate; // consistent/inconsistent state
  400. JET_LGPOS lgposConsistent; // null if in inconsistent state
  401. JET_LOGTIME logtimeConsistent; // null if in inconsistent state
  402. JET_LOGTIME logtimeAttach; // Last attach time.
  403. JET_LGPOS lgposAttach;
  404. JET_LOGTIME logtimeDetach; // Last detach time.
  405. JET_LGPOS lgposDetach;
  406. JET_SIGNATURE signLog; // (28 bytes) log signature for this attachments
  407. JET_BKINFO bkinfoFullPrev; // Last successful full backup.
  408. JET_BKINFO bkinfoIncPrev; // Last successful Incremental backup.
  409. // Reset when bkinfoFullPrev is set
  410. JET_BKINFO bkinfoFullCur; // current backup. Succeed if a
  411. // corresponding pat file generated.
  412. unsigned long fShadowingDisabled;
  413. unsigned long fUpgradeDb;
  414. // NT version information. This is needed to decide if an index need
  415. // be recreated due to sort table changes.
  416. unsigned long dwMajorVersion; /* OS version info */
  417. unsigned long dwMinorVersion;
  418. unsigned long dwBuildNumber;
  419. long lSPNumber;
  420. unsigned long cbPageSize; // database page size (0 = 4k pages)
  421. } JET_DBINFOMISC;
  422. //typedef struct
  423. // {
  424. // unsigned long cDiscont;
  425. // unsigned long cUnfixedMessyPage;
  426. // unsigned long centriesLT;
  427. // unsigned long centriesTotal;
  428. // unsigned long cpgCompactFreed;
  429. // } JET_OLCSTAT;
  430. /************************************************************************/
  431. /************************* JET CONSTANTS ************************/
  432. /************************************************************************/
  433. #define JET_tableidNil ((JET_TABLEID) 0xFFFFFFFF)
  434. #define JET_sesidNil ((JET_SESID) 0xFFFFFFFF)
  435. /* Max size of a bookmark */
  436. #define JET_cbBookmarkMost 256
  437. /* Max length of a object/column/index/property name */
  438. #define JET_cbNameMost 64
  439. /* Max length of a "name.name.name..." construct */
  440. #define JET_cbFullNameMost 255
  441. /* Max size of long-value (LongBinary or LongText) column chunk */
  442. // #define JET_cbColumnLVChunkMost ( JET_cbPage - 82 ) to the following:
  443. // Get cbPage from GetSystemParameter.
  444. // changed to cbPage - JET_cbColumnLVPageOverhead
  445. #define JET_cbColumnLVPageOverhead 82
  446. #define JET_cbColumnLVChunkMost ( 4096 - 82 ) // This def will be removed after other components change not to use this def
  447. #define JET_cbColumnLVChunkMost_OLD 4035
  448. /* Max size of long-value (LongBinary or LongText) column default value */
  449. #define JET_cbLVDefaultValueMost 255
  450. /* Max size of non-long-value column data */
  451. #define JET_cbColumnMost 255
  452. /* Max size of a sort/index key */
  453. #define JET_cbKeyMost 255
  454. #define JET_cbPrimaryKeyMost 255
  455. #define JET_cbSecondaryKeyMost 255
  456. #define JET_cbKeyMost_OLD 255
  457. /* Max number of components in a sort/index key */
  458. #define JET_ccolKeyMost 12
  459. // system paramters
  460. //
  461. // location parameters
  462. //
  463. #define JET_paramSystemPath 0 /* path to check point file [".\\"] */
  464. #define JET_paramTempPath 1 /* path to the temporary database [".\\"] */
  465. #define JET_paramLogFilePath 2 /* path to the log file directory [".\\"] */
  466. #define JET_paramLogFileFailoverPath 61 /* path to use if the log file disk should fail [none] */
  467. #define JET_paramBaseName 3 /* base name for all DBMS object names ["edb"] */
  468. #define JET_paramEventSource 4 /* language independant process descriptor string [""] */
  469. // performance parameters
  470. //
  471. #define JET_paramMaxSessions 5 /* maximum number of sessions [128] */
  472. #define JET_paramMaxOpenTables 6 /* maximum number of open directories [300]
  473. /* need 1 for each open table index,
  474. /* plus 1 for each open table with no indexes,
  475. /* plus 1 for each table with long column data,
  476. /* plus a few more.
  477. /**/
  478. /* for 4.1, 1/3 for regular table, 2/3 for index */
  479. #define JET_paramPreferredMaxOpenTables 7 /* preferred maximum number of open directories [300] */
  480. #define JET_paramMaxCursors 8 /* maximum number of open cursors [1024] */
  481. #define JET_paramMaxVerPages 9 /* maximum version store size in 16kByte units [64] */
  482. #define JET_paramPreferredVerPages 63 /* preferred version store size in 16kByte units [0] */
  483. #define JET_paramMaxTemporaryTables 10 /* maximum concurrent open temporary table/index creation [20] */
  484. #define JET_paramLogFileSize 11 /* log file size in kBytes [5120] */
  485. #define JET_paramLogBuffers 12 /* log buffers in 512 bytes [80] */
  486. #define JET_paramWaitLogFlush 13 /* log flush wait time in milliseconds [0] */
  487. #define JET_paramLogCheckpointPeriod 14 /* checkpoint period in 512 bytes [1024] */
  488. #define JET_paramLogWaitingUserMax 15 /* maximum sessions waiting log flush [3] */
  489. #define JET_paramCommitDefault 16 /* default grbit for JetCommitTransaction [0] */
  490. #define JET_paramCircularLog 17 /* boolean flag for circular logging [0] */
  491. #define JET_paramDbExtensionSize 18 /* database extension size in pages [256] */
  492. #define JET_paramPageTempDBMin 19 /* minimum size temporary database in pages [0] */
  493. #define JET_paramPageFragment 20 /* maximum disk extent considered fragment in pages [8] */
  494. #define JET_paramPageReadAheadMax 21 /* maximum read-ahead in pages [20] */
  495. // cache performance parameters
  496. //
  497. #define JET_paramBatchIOBufferMax 22 /* maximum batch I/O buffers in pages [64] */
  498. #define JET_paramCacheSizeMin 60 /* minimum cache size in pages [64] */
  499. #define JET_paramCacheSize 41 /* current cache size in pages [512] */
  500. #define JET_paramCacheSizeMax 23 /* maximum cache size in pages [512] */
  501. #define JET_paramCheckpointDepthMax 24 /* maximum checkpoint depth in bytes [20MB] */
  502. #define JET_paramLRUKCorrInterval 25 /* time (usec) under which page accesses are correlated [10000] */
  503. #define JET_paramLRUKHistoryMax 26 /* maximum LRUK history records [1024] (proportional to cache size max) */
  504. #define JET_paramLRUKPolicy 27 /* K-ness of LRUK page eviction algorithm (1...2) [2] */
  505. #define JET_paramLRUKTimeout 28 /* time (sec) after which cached pages are always evictable [100] */
  506. #define JET_paramLRUKTrxCorrInterval 29 /* time (usec) under which page accesses by the same transaction are correlated [5000000] */
  507. #define JET_paramOutstandingIOMax 30 /* maximum outstanding I/Os [64] */
  508. #define JET_paramStartFlushThreshold 31 /* evictable pages at which to start a flush [100] (proportional to CacheSizeMax) */
  509. #define JET_paramStopFlushThreshold 32 /* evictable pages at which to stop a flush [400] (proportional to CacheSizeMax) */
  510. #define JET_paramTableClassName 33 /* table stats class name (class #, string) */
  511. //
  512. //
  513. #define JET_paramExceptionAction 98 /* what to do with exceptions generated within JET */
  514. #define JET_paramEventLogCache 99 /* number of bytes of eventlog records to cache if service is not available [0] */
  515. // debug only parameters
  516. //
  517. #define JET_paramRecovery 34 /* enable recovery [-1] */
  518. #define JET_paramOnLineCompact 35 /* enable online defrag [TRUE by default] */
  519. #define JET_paramEnableOnlineDefrag 35 /* enable online defrag [TRUE by default] */
  520. #define JET_paramAssertAction 36 /* action on assert */
  521. #define JET_paramPrintFunction 37 /* synched print function [NULL] */
  522. #define JET_paramTransactionLevel 38 /* transaction level of session */
  523. #define JET_paramRFS2IOsPermitted 39 /* #IOs permitted to succeed [-1 = all] */
  524. #define JET_paramRFS2AllocsPermitted 40 /* #allocs permitted to success [-1 = all] */
  525. #define JET_paramCacheRequests 42 /* #cache requests (Read Only) */
  526. #define JET_paramCacheHits 43 /* #cache hits (Read Only) */
  527. // Application specific parameter
  528. // Used by NT only.
  529. #define JET_paramCheckFormatWhenOpenFail 44 /* JetInit may return JET_errDatabaseXXXformat instead of database corrupt when it is set */
  530. #define JET_paramEnableIndexChecking 45 /* Enable checking OS version for indexes (FALSE by default) */
  531. #define JET_paramEnableTempTableVersioning 46 /* Enable versioning of temp tables (TRUE by default) */
  532. #define JET_paramIgnoreLogVersion 47 /* Do not check the log version */
  533. #define JET_paramDeleteOldLogs 48 /* Delete the log files if the version is old, after deleting may make database non-recoverable */
  534. #define JET_paramEventSourceKey 49 /* Event source registration key value */
  535. #define JET_paramSysDbPath_OLD 0 /* path to the system database (defunct) ["<base name>.<base ext>"] */
  536. #define JET_paramSystemPath_OLD 0 /* path to check point file ["."] */
  537. #define JET_paramTempPath_OLD 1 /* path to the temporary database ["."] */
  538. #define JET_paramMaxBuffers_OLD 8 /* maximum page cache size in pages [512] */
  539. #define JET_paramMaxSessions_OLD 9 /* maximum number of sessions [128] */
  540. #define JET_paramMaxOpenTables_OLD 10 /* maximum number of open tables [300] */
  541. #define JET_paramPreferredMaxOpenTables_OLD 59 /* prefered maximum number of open tables [300] */
  542. #define JET_paramMaxVerPages_OLD 11 /* maximum version store size in 16KB buckets [64] */
  543. #define JET_paramMaxCursors_OLD 12 /* maximum number of open cursors [1024] */
  544. #define JET_paramLogFilePath_OLD 13 /* path to the log file directory ["."] */
  545. #define JET_paramMaxOpenTableIndexes_OLD 14 /* maximum open table indexes [300] */
  546. #define JET_paramMaxTemporaryTables_OLD 15 /* maximum concurrent JetCreateIndex [20] */
  547. #define JET_paramLogBuffers_OLD 16 /* maximum log buffers in 512 bytes [21] */
  548. #define JET_paramLogFileSize_OLD 17 /* maximum log file size in kBytes [5120] */
  549. #define JET_paramBfThrshldLowPrcnt_OLD 19 /* low percentage clean buffer flush start [20] */
  550. #define JET_paramBfThrshldHighPrcnt_OLD 20 /* high percentage clean buffer flush stop [80] */
  551. #define JET_paramWaitLogFlush_OLD 21 /* log flush wait time in milliseconds [15] */
  552. #define JET_paramLogCheckpointPeriod_OLD 23 /* checkpoint period in 512 bytes [1024] */
  553. #define JET_paramLogWaitingUserMax_OLD 24 /* maximum sessions waiting log flush [3] */
  554. #define JET_paramRecovery_OLD 30 /* Switch for log on/off */
  555. #define JET_paramSessionInfo_OLD 33 /* per session information [0] */
  556. #define JET_paramPageFragment_OLD 34 /* maximum disk extent considered fragment in pages [8] */
  557. #define JET_paramMaxOpenDatabases_OLD 36 /* maximum number of open databases [100] */
  558. #define JET_paramBufBatchIOMax_OLD 41 /* maximum batch IO in pages [64] */
  559. #define JET_paramPageReadAheadMax_OLD 42 /* maximum read-ahead IO in pages [20] */
  560. #define JET_paramAsynchIOMax_OLD 43 /* maximum asynchronous IO in pages [64] */
  561. #define JET_paramEventSource_OLD 45 /* language independant process descriptor string [""] */
  562. #define JET_paramDbExtensionSize_OLD 48 /* database extension size in pages [16] */
  563. #define JET_paramCommitDefault_OLD 50 /* default grbit for JetCommitTransaction [0] */
  564. #define JET_paramBufLogGenAgeThreshold_OLD 51 /* age threshold in log files [2] */
  565. #define JET_paramCircularLog_OLD 52 /* boolean flag for circular logging [0] */
  566. #define JET_paramPageTempDBMin_OLD 53 /* minimum size temporary database in pages [0] */
  567. #define JET_paramBaseName_OLD 56 /* base name for all DBMS object names ["edb"] */
  568. #define JET_paramBaseExtension_OLD 57 /* base extension for all DBMS object names ["edb"] */
  569. #define JET_paramTableClassName_OLD 58 /* table stats class name (class #, string) */
  570. #define JET_paramEnableImprovedSeekShortcut 62 /* check to see if we are seeking for the record we are currently on [false] */
  571. #define JET_paramDatabasePageSize 64 /* set database size for this ESE server */
  572. #define JET_paramErrorToString 70 /* turns a JET_err into a string (taken from the comment in jet.h) */
  573. /* Flags for JetTerm2 */
  574. #define JET_bitTermComplete 0x00000001
  575. #define JET_bitTermAbrupt 0x00000002
  576. #define JET_bitTermStopBackup 0x00000004
  577. /* Flags for JetIdle */
  578. #define JET_bitIdleFlushBuffers 0x00000001
  579. #define JET_bitIdleCompact 0x00000002
  580. #define JET_bitIdleStatus 0x00000004
  581. /* Flags for JetEndSession */
  582. #define JET_bitForceSessionClosed 0x00000001
  583. /* Flags for JetAttach/OpenDatabase */
  584. #define JET_bitDbReadOnly 0x00000001
  585. #define JET_bitDbExclusive 0x00000002 /* multiple opens allowed */
  586. #define JET_bitDbSingleExclusive 0x00000008 /* opened exactly once */
  587. #define JET_bitDbDeleteCorruptIndexes 0x00000010 /* delete indexes possibly corrupted by NT version upgrade */
  588. #define JET_bitDbRebuildCorruptIndexes 0x00000020 /* recreate indexes possibly corrupted by NT version upgrade */
  589. /* Flags for JetCreateDatabase */
  590. #define JET_bitDbRecoveryOff 0x00000008 /* disable logging/recovery for this database */
  591. #define JET_bitDbVersioningOff 0x00000040 /* INTERNAL USE ONLY */
  592. #define JET_bitDbShadowingOff 0x00000080 /* disable catalog shadowing */
  593. /* Flags for JetBackup */
  594. #define JET_bitBackupIncremental 0x00000001
  595. #define JET_bitKeepOldLogs 0x00000002
  596. #define JET_bitBackupAtomic 0x00000004
  597. /* Database types */
  598. #define JET_dbidNil ((JET_DBID) 0xFFFFFFFF)
  599. #define JET_dbidNoValid ((JET_DBID) 0xFFFFFFFE) /* used as a flag to indicate that there is no valid dbid */
  600. /* Flags for JetCreateTableColumnIndex */
  601. #define JET_bitTableCreateFixedDDL 0x00000001 /* DDL is fixed */
  602. #define JET_bitTableCreateTemplateTable 0x00000002 /* DDL is inheritable (implies FixedDDL) */
  603. #define JET_bitTableCreateSystemTable 0x80000000 /* INTERNAL USE ONLY */
  604. /* Flags for JetAddColumn, JetGetColumnInfo, JetOpenTempTable */
  605. #define JET_bitColumnFixed 0x00000001
  606. #define JET_bitColumnTagged 0x00000002
  607. #define JET_bitColumnNotNULL 0x00000004
  608. #define JET_bitColumnVersion 0x00000008
  609. #define JET_bitColumnAutoincrement 0x00000010
  610. #define JET_bitColumnUpdatable 0x00000020 /* JetGetColumnInfo only */
  611. #define JET_bitColumnTTKey 0x00000040 /* JetOpenTempTable only */
  612. #define JET_bitColumnTTDescending 0x00000080 /* JetOpenTempTable only */
  613. #define JET_bitColumnMultiValued 0x00000400
  614. #define JET_bitColumnEscrowUpdate 0x00000800 /* escrow updated */
  615. #define JET_bitColumnUnversioned 0x00001000 /* for add column only - add column unversioned */
  616. /* Flags for JetSetCurrentIndex */
  617. #define JET_bitMoveFirst 0x00000000
  618. #define JET_bitMoveBeforeFirst 0x00000001 // unsupported -- DO NOT USE
  619. #define JET_bitNoMove 0x00000002
  620. /* Flags for JetMakeKey */
  621. #define JET_bitNewKey 0x00000001
  622. #define JET_bitStrLimit 0x00000002
  623. #define JET_bitSubStrLimit 0x00000004
  624. #define JET_bitNormalizedKey 0x00000008
  625. #define JET_bitKeyDataZeroLength 0x00000010
  626. /* Flags for ErrDispSetIndexRange */
  627. #define JET_bitRangeInclusive 0x00000001
  628. #define JET_bitRangeUpperLimit 0x00000002
  629. #define JET_bitRangeInstantDuration 0x00000004
  630. #define JET_bitRangeRemove 0x00000008
  631. /* Flags for JetGetLock */
  632. #define JET_bitReadLock 0x00000001
  633. #define JET_bitWriteLock 0x00000002
  634. /* Constants for JetMove */
  635. #define JET_MoveFirst (0x80000000)
  636. #define JET_MovePrevious (-1)
  637. #define JET_MoveNext (+1)
  638. #define JET_MoveLast (0x7fffffff)
  639. /* Flags for JetMove */
  640. #define JET_bitMoveKeyNE 0x00000001
  641. /* Flags for JetSeek */
  642. #define JET_bitSeekEQ 0x00000001
  643. #define JET_bitSeekLT 0x00000002
  644. #define JET_bitSeekLE 0x00000004
  645. #define JET_bitSeekGE 0x00000008
  646. #define JET_bitSeekGT 0x00000010
  647. #define JET_bitSetIndexRange 0x00000020
  648. /* Flags for JET_CONDITIONALCOLUMN */
  649. #define JET_bitIndexColumnMustBeNull 0x00000001
  650. #define JET_bitIndexColumnMustBeNonNull 0x00000002
  651. /* Flags for JetCreateIndex */
  652. #define JET_bitIndexUnique 0x00000001
  653. #define JET_bitIndexPrimary 0x00000002
  654. #define JET_bitIndexDisallowNull 0x00000004
  655. #define JET_bitIndexIgnoreNull 0x00000008
  656. #define JET_bitIndexClustered40 0x00000010 /* for backward compatibility */
  657. #define JET_bitIndexIgnoreAnyNull 0x00000020
  658. #define JET_bitIndexIgnoreFirstNull 0x00000040
  659. #define JET_bitIndexLazyFlush 0x00000080
  660. #define JET_bitIndexEmpty 0x00000100 // don't attempt to build index, because all entries would evaluate to NULL (MUST also specify JET_bitIgnoreAnyNull)
  661. #define JET_bitIndexUnversioned 0x00000200
  662. #define JET_bitIndexSortNullsHigh 0x00000400 // NULL sorts after data for all columns in the index
  663. // UNDONE: Remove the following:
  664. // #define JET_bitIndexClustered JET_bitIndexPrimary primary index is the clustered index
  665. // #define JET_bitIndexEmptyTable 0x40000000
  666. /* Flags for index key definition */
  667. #define JET_bitKeyAscending 0x00000000
  668. #define JET_bitKeyDescending 0x00000001
  669. /* Flags for JetOpenTable */
  670. #define JET_bitTableDenyWrite 0x00000001
  671. #define JET_bitTableDenyRead 0x00000002
  672. #define JET_bitTableReadOnly 0x00000004
  673. #define JET_bitTableUpdatable 0x00000008
  674. #define JET_bitTablePermitDDL 0x00000010 /* override table flagged as FixedDDL (must be used with DenyRead) */
  675. #define JET_bitTableNoCache 0x00000020 /* don't cache the pages for this table */
  676. #define JET_bitTablePreread 0x00000040 /* assume the table is probably not in the buffer cache */
  677. #define JET_bitTableDelete 0x10000000 /* INTERNAL USE ONLY */
  678. #define JET_bitTableClassMask 0x000F0000 /* table stats class mask */
  679. #define JET_bitTableClassNone 0x00000000 /* table belongs to no stats class (default) */
  680. #define JET_bitTableClass1 0x00010000 /* table belongs to stats class 1 */
  681. #define JET_bitTableClass2 0x00020000 /* table belongs to stats class 2 */
  682. #define JET_bitTableClass3 0x00030000 /* table belongs to stats class 3 */
  683. #define JET_bitTableClass4 0x00040000 /* table belongs to stats class 4 */
  684. #define JET_bitTableClass5 0x00050000 /* table belongs to stats class 5 */
  685. #define JET_bitTableClass6 0x00060000 /* table belongs to stats class 6 */
  686. #define JET_bitTableClass7 0x00070000 /* table belongs to stats class 7 */
  687. #define JET_bitTableClass8 0x00080000 /* table belongs to stats class 8 */
  688. #define JET_bitTableClass9 0x00090000 /* table belongs to stats class 9 */
  689. #define JET_bitTableClass10 0x000A0000 /* table belongs to stats class 10 */
  690. #define JET_bitTableClass11 0x000B0000 /* table belongs to stats class 11 */
  691. #define JET_bitTableClass12 0x000C0000 /* table belongs to stats class 12 */
  692. #define JET_bitTableClass13 0x000D0000 /* table belongs to stats class 13 */
  693. #define JET_bitTableClass14 0x000E0000 /* table belongs to stats class 14 */
  694. #define JET_bitTableClass15 0x000F0000 /* table belongs to stats class 15 */
  695. /* Flags for JetOpenTempTable and ErrIsamOpenTempTable */
  696. #define JET_bitTTIndexed 0x00000001 /* Allow seek */
  697. #define JET_bitTTUnique 0x00000002 /* Remove duplicates */
  698. #define JET_bitTTUpdatable 0x00000004 /* Allow updates */
  699. #define JET_bitTTScrollable 0x00000008 /* Allow backwards scrolling */
  700. #define JET_bitTTSortNullsHigh 0x00000010 /* NULL sorts after data for all columns in the index */
  701. #define JET_bitTTForceMaterialization 0x00000020 /* Forces temp. table to be materialized into a btree (allows for duplicate detection) */
  702. #define JET_bitTTErrorOnDuplicateInsertion JET_bitTTForceMaterialization /* Error always returned when duplicate is inserted (instead of dupe being silently removed) */
  703. /* Flags for JetSetColumn */
  704. #define JET_bitSetAppendLV 0x00000001
  705. #define JET_bitSetOverwriteLV 0x00000004 /* overwrite JET_coltypLong* byte range */
  706. #define JET_bitSetSizeLV 0x00000008 /* set JET_coltypLong* size */
  707. #define JET_bitSetZeroLength 0x00000020
  708. #define JET_bitSetSeparateLV 0x00000040 /* force LV separation */
  709. #define JET_bitSetUniqueMultiValues 0x00000080 /* prevent duplicate multi-values */
  710. /* Set column parameter structure for JetSetColumns */
  711. typedef struct {
  712. JET_COLUMNID columnid;
  713. const void *pvData;
  714. unsigned long cbData;
  715. JET_GRBIT grbit;
  716. unsigned long ibLongValue;
  717. unsigned long itagSequence;
  718. JET_ERR err;
  719. } JET_SETCOLUMN;
  720. /* Options for JetPrepareUpdate */
  721. #define JET_prepInsert 0
  722. #define JET_prepReplace 2
  723. #define JET_prepCancel 3
  724. #define JET_prepReplaceNoLock 4
  725. #define JET_prepInsertCopy 5
  726. /* Flags for JetEscrowUpdate */
  727. #define JET_bitEscrowNoRollback 0x0001
  728. /* Flags for JetRetrieveColumn */
  729. #define JET_bitRetrieveCopy 0x00000001
  730. #define JET_bitRetrieveFromIndex 0x00000002
  731. #define JET_bitRetrieveTag 0x00000008
  732. #define JET_bitRetrieveNull 0x00000010 /* for columnid 0 only */
  733. #define JET_bitRetrieveIgnoreDefault 0x00000020 /* for columnid 0 only */
  734. #define JET_bitRetrieveLongId 0x00000040
  735. #define JET_bitRetrieveLongValueRefCount 0x00000080 /* for testing use only */
  736. /* Retrieve column parameter structure for JetRetrieveColumns */
  737. typedef struct {
  738. JET_COLUMNID columnid;
  739. void *pvData;
  740. unsigned long cbData;
  741. unsigned long cbActual;
  742. JET_GRBIT grbit;
  743. unsigned long ibLongValue;
  744. unsigned long itagSequence;
  745. JET_COLUMNID columnidNextTagged;
  746. JET_ERR err;
  747. } JET_RETRIEVECOLUMN;
  748. struct JET_RETRIEVEMULTIVALUECOUNT
  749. {
  750. JET_COLUMNID columnid;
  751. unsigned short cMultiValues;
  752. union
  753. {
  754. unsigned short usFlags;
  755. struct
  756. {
  757. unsigned short fLongValue:1; // is column LongText/Binary?
  758. unsigned short fDefaultValue:1; // was a default value retrieved?
  759. unsigned short fNullOverride:1; // was there an explicit null to override a default value?
  760. };
  761. };
  762. };
  763. /* Flags for JetCommitTransaction */
  764. #define JET_bitCommitLazyFlush 0x00000001 /* lazy flush log buffers. */
  765. #define JET_bitWaitLastLevel0Commit 0x00000002 /* wait for last level 0 commit record flushed */
  766. #define JET_bitCommitFlush_OLD 0x00000001 /* commit and flush page buffers. */
  767. #define JET_bitCommitLazyFlush_OLD 0x00000004 /* lazy flush log buffers. */
  768. #define JET_bitWaitLastLevel0Commit_OLD 0x00000010 /* wait for last level 0 commit record flushed */
  769. /* Flags for JetRollback */
  770. #define JET_bitRollbackAll 0x00000001
  771. /* Info parameter for JetGetDatabaseInfo */
  772. #define JET_DbInfoFilename 0
  773. #define JET_DbInfoConnect 1
  774. #define JET_DbInfoCountry 2
  775. #define JET_DbInfoLangid 3
  776. #define JET_DbInfoCp 4
  777. #define JET_DbInfoCollate 5
  778. #define JET_DbInfoOptions 6
  779. #define JET_DbInfoTransactions 7
  780. #define JET_DbInfoVersion 8
  781. #define JET_DbInfoIsam 9
  782. #define JET_DbInfoFilesize 10
  783. #define JET_DbInfoSpaceOwned 11
  784. #define JET_DbInfoSpaceAvailable 12
  785. #define JET_DbInfoUpgrade 13
  786. #define JET_DbInfoMisc 14
  787. /* Dbstates from JetGetDatabaseFileInfo */
  788. #define JET_dbstateJustCreated 1
  789. #define JET_dbstateInconsistent 2
  790. #define JET_dbstateConsistent 3
  791. #define JET_dbstateBeingConverted 4
  792. /* Column data types */
  793. #define JET_coltypNil 0
  794. #define JET_coltypBit 1 /* True or False, Never NULL */
  795. #define JET_coltypUnsignedByte 2 /* 1-byte integer, unsigned */
  796. #define JET_coltypShort 3 /* 2-byte integer, signed */
  797. #define JET_coltypLong 4 /* 4-byte integer, signed */
  798. #define JET_coltypCurrency 5 /* 8 byte integer, signed */
  799. #define JET_coltypIEEESingle 6 /* 4-byte IEEE single precision */
  800. #define JET_coltypIEEEDouble 7 /* 8-byte IEEE double precision */
  801. #define JET_coltypDateTime 8 /* Integral date, fractional time */
  802. #define JET_coltypBinary 9 /* Binary data, < 255 bytes */
  803. #define JET_coltypText 10 /* ANSI text, case insensitive, < 255 bytes */
  804. #define JET_coltypLongBinary 11 /* Binary data, long value */
  805. #define JET_coltypLongText 12 /* ANSI text, long value */
  806. #define JET_coltypMax 13 /* the number of column types */
  807. /* used for validity tests and */
  808. /* array declarations. */
  809. /* Info levels for JetGetObjectInfo */
  810. #define JET_ObjInfo 0U
  811. #define JET_ObjInfoListNoStats 1U
  812. #define JET_ObjInfoList 2U
  813. #define JET_ObjInfoSysTabCursor 3U
  814. #define JET_ObjInfoListACM 4U /* Blocked by JetGetObjectInfo */
  815. #define JET_ObjInfoNoStats 5U
  816. #define JET_ObjInfoSysTabReadOnly 6U
  817. #define JET_ObjInfoRulesLoaded 7U
  818. #define JET_ObjInfoMax 8U
  819. /* Info levels for JetGetTableInfo */
  820. #define JET_TblInfo 0U
  821. #define JET_TblInfoName 1U
  822. #define JET_TblInfoDbid 2U
  823. #define JET_TblInfoMostMany 3U
  824. #define JET_TblInfoRvt 4U
  825. #define JET_TblInfoOLC 5U
  826. #define JET_TblInfoResetOLC 6U
  827. #define JET_TblInfoSpaceUsage 7U
  828. #define JET_TblInfoDumpTable 8U
  829. #define JET_TblInfoSpaceAlloc 9U
  830. #define JET_TblInfoSpaceOwned 10U // OwnExt
  831. #define JET_TblInfoSpaceAvailable 11U // AvailExt
  832. #define JET_TblInfoTemplateTableName 12U
  833. /* Info levels for JetGetIndexInfo and JetGetTableIndexInfo */
  834. #define JET_IdxInfo 0U
  835. #define JET_IdxInfoList 1U
  836. #define JET_IdxInfoSysTabCursor 2U
  837. #define JET_IdxInfoOLC 3U
  838. #define JET_IdxInfoResetOLC 4U
  839. #define JET_IdxInfoSpaceAlloc 5U
  840. #define JET_IdxInfoLangid 6U
  841. #define JET_IdxInfoCount 7U
  842. #define JET_IdxInfoVarSegMac 8U
  843. /* Info levels for JetGetColumnInfo and JetGetTableColumnInfo */
  844. #define JET_ColInfo 0U
  845. #define JET_ColInfoList 1U
  846. #define JET_ColInfoSysTabCursor 3U
  847. #define JET_ColInfoBase 4U
  848. #define JET_ColInfoListCompact 5U
  849. /* Engine Object Types */
  850. #define JET_objtypNil 0
  851. #define JET_objtypTable 1
  852. #define JET_objtypDb 2
  853. #define JET_objtypContainer 3
  854. #define JET_objtypLongRoot 9 /* INTERNAL USE ONLY */
  855. /* Compact Options */
  856. #define JET_bitCompactStats 0x00000020 /* Dump off-line compaction stats (only when progress meter also specified) */
  857. #define JET_bitCompactRepair 0x00000040 /* Don't preread and ignore duplicate keys */
  858. /* Status Notification Processes */
  859. #define JET_snpRepair 2
  860. #define JET_snpCompact 4
  861. #define JET_snpRestore 8
  862. #define JET_snpBackup 9
  863. #define JET_snpUpgrade 10
  864. /* Status Notification Types */
  865. #define JET_sntBegin 5 /* callback for beginning of operation */
  866. #define JET_sntRequirements 7 /* callback for returning operation requirements */
  867. #define JET_sntProgress 0 /* callback for progress */
  868. #define JET_sntComplete 6 /* callback for completion of operation */
  869. #define JET_sntFail 3 /* callback for failure during progress */
  870. /* Exception action */
  871. #define JET_ExceptionMsgBox 0x0001 /* Display message box on exception */
  872. #define JET_ExceptionNone 0x0002 /* Do nothing on exceptions */
  873. /* AssertAction */
  874. #define JET_AssertExit 0x0000 /* Exit the application */
  875. #define JET_AssertBreak 0x0001 /* Break to debugger */
  876. #define JET_AssertMsgBox 0x0002 /* Display message box */
  877. #define JET_AssertStop 0x0004 /* Alert and stop */
  878. /* Counter flags */ // For XJET only, not for JET97
  879. #define ctAccessPage 1
  880. #define ctLatchConflict 2
  881. #define ctSplitRetry 3
  882. #define ctNeighborPageScanned 4
  883. #define ctSplits 5
  884. /**********************************************************************/
  885. /*********************** ERROR CODES **************************/
  886. /**********************************************************************/
  887. /* SUCCESS */
  888. #define JET_errSuccess 0 /* Successful Operation */
  889. /* ERRORS */
  890. #define JET_wrnNyi -1 /* Function Not Yet Implemented */
  891. /* SYSTEM errors
  892. /**/
  893. #define JET_errRfsFailure -100 /* JET_errRfsFailure */
  894. #define JET_errRfsNotArmed -101 /* JET_errRfsFailure */
  895. #define JET_errFileClose -102 /* Could not close DOS file */
  896. #define JET_errOutOfThreads -103 /* Could not start thread */
  897. #define JET_errTooManyIO -105 /* System busy due to too many IOs */
  898. // BUFFER MANAGER errors
  899. //
  900. #define wrnBFCacheMiss 200 /* page latch caused a cache miss */
  901. #define errBFPageNotCached -201 /* page is not cached */
  902. #define errBFLatchConflict -202 /* page latch conflict */
  903. #define errBFIPageEvicted -250 /* page evicted from the cache */
  904. #define errBFIPageCached -251 /* page already cached */
  905. #define errBFIOutOfOLPs -252 /* out of OLPs */
  906. #define errBFIOutOfBatchIOBuffers -253 /* out of Batch I/O Buffers */
  907. #define errBFINoBufferAvailable -254 /* no buffer available for immediate use */
  908. #define JET_errDatabaseBufferDependenciesCorrupted -255 // buffer dependencies were improperly set
  909. // VERSION STORE errors
  910. //
  911. #define wrnVERRCEMoved 275 /* RCE was moved instead of being cleaned */
  912. /* DIRECTORY MANAGER errors
  913. /**/
  914. #define errPMOutOfPageSpace -300 /* Out of page space */
  915. #define errPMItagTooBig -301 /* Itag too big */ // XXX -- to be deleted
  916. #define errPMRecDeleted -302 /* Record deleted */ // XXX -- to be deleted
  917. #define errPMTagsUsedUp -303 /* Tags used up */ // XXX -- to be deleted
  918. #define wrnBMConflict 304 /* conflict in BM Clean up */
  919. #define errDIRNoShortCircuit -305 /* No Short Circuit Avail */
  920. #define errDIRCannotSplit -306 /* Cannot horizontally split FDP */
  921. #define errDIRTop -307 /* Cannot go up */
  922. #define errDIRFDP 308 /* On an FDP Node */
  923. #define errDIRNotSynchronous -309 /* May have left critical section */
  924. #define wrnDIREmptyPage 310 /* Moved through empty page */
  925. #define errSPConflict -311 /* Device extent being extended */
  926. #define wrnNDFoundLess 312 /* Found Less */
  927. #define wrnNDFoundGreater 313 /* Found Greater */
  928. #define wrnNDNotFoundInPage 314 /* for smart refresh */
  929. #define errNDNotFound -312 /* Not found */
  930. #define errNDOutSonRange -314 /* Son out of range */
  931. #define errNDOutItemRange -315 /* Item out of range */
  932. #define errNDGreaterThanAllItems -316 /* Greater than all items */
  933. #define errNDLastItemNode -317 /* Last node of item list */
  934. #define errNDFirstItemNode -318 /* First node of item list */
  935. #define wrnNDDuplicateItem 319 /* Duplicated Item */
  936. #define errNDNoItem -320 /* Item not there */
  937. #define JET_wrnRemainingVersions 321 /* Some versions couldn't be cleaned */
  938. #define JET_errPreviousVersion -322 /* Version already existed */
  939. #define JET_errPageBoundary -323 /* Reached Page Boundary */
  940. #define JET_errKeyBoundary -324 /* Reached Key Boundary */
  941. #define errDIRInPageFather -325 /* sridFather in page to free */
  942. #define errBMMaxKeyInPage -326 /* used by OLC to avoid cleanup of parent pages */
  943. #define JET_errBadPageLink -327 /* next/previous page link page does not point back to source */
  944. #define JET_errBadBookmark -328 /* bookmark has no corresponding address in database */
  945. #define wrnBMCleanNullOp 329 // BMClean returns this on encountering a page
  946. // deleted MaxKeyInPage [but there was no conflict]
  947. #define errBTOperNone -330 // Split with no accompanying
  948. // insert/replace
  949. #define errSPOutOfAvailExtCacheSpace -331 // unable to make update to AvailExt tree since
  950. // in-cursor space cache is depleted
  951. #define errSPOutOfOwnExtCacheSpace -332 // unable to make update to OwnExt tree since
  952. // in-cursor space cache is depleted
  953. #define wrnBTMultipageOLC 333 // needs multipage OLC operation
  954. #define JET_errNTSystemCallFailed -334 // can not get OS version
  955. #define wrnBTShallowTree 335 // BTree is only one or two levels deeps
  956. #define errBTMergeNotSynchronous -336 // Multiple threads attempting to perform merge/split on same page (likely OLD vs. RCEClean)
  957. /* RECORD MANAGER errors
  958. /**/
  959. #define wrnFLDKeyTooBig 400 /* Key too big (truncated it) */
  960. #define errFLDTooManySegments -401 /* Too many key segments */
  961. #define wrnFLDNullKey 402 /* Key is entirely NULL */
  962. #define wrnFLDOutOfKeys 403 /* No more keys to extract */
  963. #define wrnFLDNullSeg 404 /* Null segment in key */
  964. #define wrnFLDNotPresentInIndex 405
  965. #define JET_wrnSeparateLongValue 406 /* Separated long value */
  966. #define wrnRECLongField 407 /* Separated long value */
  967. #define JET_wrnRecordFoundGreater JET_wrnSeekNotEqual
  968. #define JET_wrnRecordFoundLess JET_wrnSeekNotEqual
  969. #define JET_errColumnIllegalNull JET_errNullInvalid
  970. #define wrnFLDNullFirstSeg 408 /* Null first segment in key */
  971. #define JET_errKeyTooBig -408 /* Key with column truncation still truncated */
  972. /* LOGGING/RECOVERY errors
  973. /**/
  974. #define JET_errInvalidLoggedOperation -500 /* Logged operation cannot be redone */
  975. #define JET_errLogFileCorrupt -501 /* Log file is corrupt */
  976. #define errLGNoMoreRecords -502 /* Last log record read */
  977. #define JET_errNoBackupDirectory -503 /* No backup directory given */
  978. #define JET_errBackupDirectoryNotEmpty -504 /* The backup directory is not emtpy */
  979. #define JET_errBackupInProgress -505 /* Backup is active already */
  980. #define JET_errRestoreInProgress -506 /* Restore in progress */
  981. #define JET_errMissingPreviousLogFile -509 /* Missing the log file for check point */
  982. #define JET_errLogWriteFail -510 /* Fail when writing to log file */
  983. #define JET_errBadLogVersion -514 /* Version of log file is not compatible with Jet version */
  984. #define JET_errInvalidLogSequence -515 /* Timestamp in next log does not match expected */
  985. #define JET_errLoggingDisabled -516 /* Log is not active */
  986. #define JET_errLogBufferTooSmall -517 /* Log buffer is too small for recovery */
  987. #define errLGNotSynchronous -518 /* retry to LGLogRec */
  988. #define JET_errLogSequenceEnd -519 /* Exceed maximum log file number */
  989. #define JET_errNoBackup -520 /* No backup in progress */
  990. #define JET_errInvalidBackupSequence -521 /* Backup call out of sequence */
  991. #define JET_errBackupNotAllowedYet -523 /* Can not do backup now */
  992. #define JET_errDeleteBackupFileFail -524 /* Could not delete backup file */
  993. #define JET_errMakeBackupDirectoryFail -525 /* Could not make backup temp directory */
  994. #define JET_errInvalidBackup -526 /* Cannot incremental backup when circular logging enabled */
  995. #define JET_errRecoveredWithErrors -527 /* For repair, restored with errors */
  996. #define JET_errMissingLogFile -528 /* current log file missing */
  997. #define JET_errLogDiskFull -529 /* log disk full */
  998. #define JET_errBadLogSignature -530 /* bad signature for a log file */
  999. #define JET_errBadDbSignature -531 /* bad signature for a db file */
  1000. #define JET_errBadCheckpointSignature -532 /* bad signature for a checkpoint file */
  1001. #define JET_errCheckpointCorrupt -533 /* checkpoint file not found or corrupt */
  1002. #define JET_errMissingPatchPage -534 /* patch file page not found during recovery */
  1003. #define JET_errBadPatchPage -535 /* patch file page is not valid */
  1004. #define JET_errRedoAbruptEnded -536 /* Redo abruptly ended due to sudden failure in reading logs from log file */
  1005. #define JET_errDatabaseInconsistent -550 /* database is in inconsistent state */
  1006. #define JET_errConsistentTimeMismatch -551 /* database last consistent time unmatched */
  1007. #define JET_errDatabasePatchFileMismatch -552 /* patch file is not generated from this backup */
  1008. #define JET_errEndingRestoreLogTooLow -553 /* the starting log number too low for the restore */
  1009. #define JET_errStartingRestoreLogTooHigh -554 /* the starting log number too high for the restore */
  1010. #define JET_errGivenLogFileHasBadSignature -555 /* Restore log file has bad signature */
  1011. #define JET_errGivenLogFileIsNotContiguous -556 /* Restore log file is not contiguous */
  1012. #define JET_errMissingRestoreLogFiles -557 /* Some restore log files are missing */
  1013. #define JET_wrnExistingLogFileHasBadSignature 558 /* Existing log file has bad signature */
  1014. #define JET_wrnExistingLogFileIsNotContiguous 559 /* Existing log file is not contiguous */
  1015. #define JET_errMissingFullBackup -560 /* The database miss a previous full backup befor incremental backup */
  1016. #define JET_errBadBackupDatabaseSize -561 /* The backup database size is not in 4k */
  1017. #define JET_errDatabaseAlreadyUpgraded -562 /* Attempted to upgrade a database that is already current */
  1018. #define JET_errDatabaseIncompleteUpgrade -563 /* Attempted to use a database which was only partially converted to the current format -- must restore from backup */
  1019. #define JET_wrnSkipThisRecord 564 /* Skip this record, used by convert, internal only */
  1020. #define JET_errInvalidGrbit -900 /* Grbit is not valid in the context of this API call */
  1021. #define JET_errTermInProgress -1000 /* Termination in progress */
  1022. #define JET_errFeatureNotAvailable -1001 /* API not supported */
  1023. #define JET_errInvalidName -1002 /* Invalid name */
  1024. #define JET_errInvalidParameter -1003 /* Invalid API parameter */
  1025. #define JET_wrnColumnNull 1004 /* Column is NULL-valued */
  1026. #define JET_wrnBufferTruncated 1006 /* Buffer too small for data */
  1027. #define JET_wrnDatabaseAttached 1007 /* Database is already attached */
  1028. #define JET_errDatabaseFileReadOnly -1008 /* Attach a readonly database file for read/write operations */
  1029. #define JET_wrnSortOverflow 1009 /* Sort does not fit in memory */
  1030. #define JET_errInvalidDatabaseId -1010 /* Invalid database id */
  1031. #define JET_errOutOfMemory -1011 /* Out of Memory */
  1032. #define JET_errOutOfDatabaseSpace -1012 /* Maximum database size reached */
  1033. #define JET_errOutOfCursors -1013 /* Out of table cursors */
  1034. #define JET_errOutOfBuffers -1014 /* Out of database page buffers */
  1035. #define JET_errTooManyIndexes -1015 /* Too many indexes */
  1036. #define JET_errTooManyKeys -1016 /* Too many columns in an index */
  1037. #define JET_errRecordDeleted -1017 /* Record has been deleted */
  1038. #define JET_errReadVerifyFailure -1018 /* Read verification error */
  1039. #define JET_errPageNotInitialized -1019 /* Repair Only: Read an unused page */
  1040. #define JET_errOutOfFileHandles -1020 /* Out of file handles */
  1041. #define JET_errDiskIO -1022 /* Disk IO error */
  1042. #define JET_errInvalidPath -1023 /* Invalid file path */
  1043. #define JET_errInvalidSystemPath -1024 /* Invalid system path */
  1044. #define JET_errInvalidLogDirectory -1025 /* Invalid log directory */
  1045. #define JET_errRecordTooBig -1026 /* Record larger than maximum size */
  1046. #define JET_errTooManyOpenDatabases -1027 /* Too many open databases */
  1047. #define JET_errInvalidDatabase -1028 /* Not a database file */
  1048. #define JET_errNotInitialized -1029 /* JetInit not yet called */
  1049. #define JET_errAlreadyInitialized -1030 /* JetInit already called */
  1050. #define JET_errInitInProgress -1031 /* JetInit is underway */
  1051. #define JET_errFileAccessDenied -1032 /* Cannot access file, the file is locked or in use */
  1052. #define JET_errQueryNotSupported -1034 /* Query support unavailable */ // XXX -- to be deleted
  1053. #define JET_errSQLLinkNotSupported -1035 /* SQL Link support unavailable */ // XXX -- to be deleted
  1054. #define JET_errBufferTooSmall -1038 /* Buffer is too small */
  1055. #define JET_wrnSeekNotEqual 1039 /* SeekLE or SeekGE didn't find exact match */
  1056. #define JET_errTooManyColumns -1040 /* Too many columns defined */
  1057. #define JET_errContainerNotEmpty -1043 /* Container is not empty */
  1058. #define JET_errInvalidFilename -1044 /* Filename is invalid */
  1059. #define JET_errInvalidBookmark -1045 /* Invalid bookmark */
  1060. #define JET_errColumnInUse -1046 /* Column used in an index */
  1061. #define JET_errInvalidBufferSize -1047 /* Data buffer doesn't match column size */
  1062. #define JET_errColumnNotUpdatable -1048 /* Cannot set column value */
  1063. #define JET_errIndexInUse -1051 /* Index is in use */
  1064. #define JET_errLinkNotSupported -1052 /* Link support unavailable */
  1065. #define JET_errNullKeyDisallowed -1053 /* Null keys are disallowed on index */
  1066. #define JET_errNotInTransaction -1054 /* Operation must be within a transaction */
  1067. #define JET_wrnNoErrorInfo 1055 /* No extended error information */
  1068. #define JET_wrnNoIdleActivity 1058 /* No idle activity occured */
  1069. #define JET_errTooManyActiveUsers -1059 /* Too many active database users */
  1070. #define JET_errInvalidCountry -1061 /* Invalid or unknown country code */
  1071. #define JET_errInvalidLanguageId -1062 /* Invalid or unknown language id */
  1072. #define JET_errInvalidCodePage -1063 /* Invalid or unknown code page */
  1073. #define JET_wrnNoWriteLock 1067 /* No write lock at transaction level 0 */
  1074. #define JET_wrnColumnSetNull 1068 /* Column set to NULL-value */
  1075. #define JET_errVersionStoreOutOfMemory -1069 /* lMaxVerPages exceeded (XJET only) */
  1076. #define JET_errCurrencyStackOutOfMemory -1070 /* lCSRPerfFUCB * lMaxCursors exceeded (XJET only) */
  1077. #define JET_errCannotIndex -1071 /* Cannot index escrow column */
  1078. #define JET_errRecordNotDeleted -1072 /* Record has not been deleted */
  1079. #define JET_errOutOfSessions -1101 /* Out of sessions */
  1080. #define JET_errWriteConflict -1102 /* Write lock failed due to outstanding write lock */
  1081. #define JET_errTransTooDeep -1103 /* Xactions nested too deeply */
  1082. #define JET_errInvalidSesid -1104 /* Invalid session handle */
  1083. #define JET_errWriteConflictPrimaryIndex -1105 /* update attempted on uncommitted primary index */
  1084. #define JET_errInTransaction -1108 /* Operation not allowed within a transaction */
  1085. #define JET_errRollbackRequired -1109 /* Must rollback current transaction -- cannot commit or begin a new one */
  1086. #define JET_errDatabaseDuplicate -1201 /* Database already exists */
  1087. #define JET_errDatabaseInUse -1202 /* Database in use */
  1088. #define JET_errDatabaseNotFound -1203 /* No such database */
  1089. #define JET_errDatabaseInvalidName -1204 /* Invalid database name */
  1090. #define JET_errDatabaseInvalidPages -1205 /* Invalid number of pages */
  1091. #define JET_errDatabaseCorrupted -1206 /* non-db file or corrupted db */
  1092. #define JET_errDatabaseLocked -1207 /* Database exclusively locked */
  1093. #define JET_errCannotDisableVersioning -1208 /* Cannot disable versioning for this database */
  1094. #define JET_errInvalidDatabaseVersion -1209 /* Database engine is incompatible with database */
  1095. /* The following error code are for NT clients only. It will return such error during
  1096. * JetInit if JET_paramCheckFormatWhenOpenFail is set.
  1097. */
  1098. #define JET_errDatabase200Format -1210 /* The database is in 200 format */
  1099. #define JET_errDatabase400Format -1211 /* The database is in 400 format */
  1100. #define JET_errDatabase500Format -1212 /* The database is in 500 format */
  1101. #define JET_errPageSizeMismatch -1213 /* The database page size is not matching with the engine */
  1102. #define JET_wrnTableEmpty 1301 /* Open an empty table */
  1103. #define JET_errTableLocked -1302 /* Table is exclusively locked */
  1104. #define JET_errTableDuplicate -1303 /* Table already exists */
  1105. #define JET_errTableInUse -1304 /* Table is in use, cannot lock */
  1106. #define JET_errObjectNotFound -1305 /* No such table or object */
  1107. #define JET_errDensityInvalid -1307 /* Bad file/index density */
  1108. #define JET_errTableNotEmpty -1308 /* Cannot define clustered index */
  1109. #define JET_errInvalidTableId -1310 /* Invalid table id */
  1110. #define JET_errTooManyOpenTables -1311 /* Cannot open any more tables (cleanup already attempted) */
  1111. #define JET_errIllegalOperation -1312 /* Oper. not supported on table */
  1112. #define JET_errObjectDuplicate -1314 /* Table or object name in use */
  1113. #define JET_errInvalidObject -1316 /* object is invalid for operation */
  1114. #define JET_errCannotDeleteTempTable -1317 /* use CloseTable instead of DeleteTable to delete temp table */
  1115. #define JET_errCannotDeleteSystemTable -1318 /* illegal attempt to delete a system table */
  1116. #define JET_errCannotDeleteTemplateTable -1319 /* illegal attempt to delete a template table */
  1117. #define errFCBTooManyOpen -1320 /* Cannot open any more FCB's (cleanup not yet attempted) */
  1118. #define errFCBAboveThreshold -1321 /* Can only allocate FCB above preferred threshold (cleanup not yet attempted) */
  1119. #define JET_errExclusiveTableLockRequired -1322 /* Must have exclusive lock on table. */
  1120. #define JET_errFixedDDL -1323 /* DDL operations prohibited on this table */
  1121. #define JET_errFixedInheritedDDL -1324 /* On a derived table, DDL operations are prohibited on inherited portion of DDL */
  1122. #define JET_errCannotNestDDL -1325 /* Nesting of hierarchical DDL is not currently supported. */
  1123. #define JET_errDDLNotInheritable -1326 /* Tried to inherit DDL from a table not marked as a template table. */
  1124. #define JET_wrnTableInUseBySystem 1327 /* System cleanup has a cursor open on the table */
  1125. #define JET_errInvalidSettings -1328 /* System parameter were set improperly */
  1126. #define JET_errClientRequestToStopJetService -1329 /* Client has requested stop service */
  1127. #define JET_errIndexCantBuild -1401 /* Index build failed */
  1128. #define JET_errIndexHasPrimary -1402 /* Primary index already defined */
  1129. #define JET_errIndexDuplicate -1403 /* Index is already defined */
  1130. #define JET_errIndexNotFound -1404 /* No such index */
  1131. #define JET_errIndexMustStay -1405 /* Cannot delete clustered index */
  1132. #define JET_errIndexInvalidDef -1406 /* Illegal index definition */
  1133. #define JET_errInvalidCreateIndex -1409 /* Invalid create index description */
  1134. #define JET_errTooManyOpenIndexes -1410 /* Out of index description blocks */
  1135. #define JET_errMultiValuedIndexViolation -1411 /* Non-unique inter-record index keys generated for a multivalued index */
  1136. #define JET_errIndexBuildCorrupted -1412 /* Failed to build a secondary index that properly reflects primary index */
  1137. #define JET_errPrimaryIndexCorrupted -1413 /* Primary index is corrupt -- defrag required */
  1138. #define JET_errSecondaryIndexCorrupted -1414 /* Secondary index is corrupt -- defrag required */
  1139. #define JET_wrnCorruptIndexDeleted 1415 /* Out of date index of the attached db is removed */
  1140. #define JET_errColumnLong -1501 /* Column value is long */
  1141. #define JET_errColumnNoChunk -1502 /* no such chunk in long value */
  1142. #define JET_errColumnDoesNotFit -1503 /* Field will not fit in record */
  1143. #define JET_errNullInvalid -1504 /* Null not valid */
  1144. #define JET_errColumnIndexed -1505 /* Column indexed, cannot delete */
  1145. #define JET_errColumnTooBig -1506 /* Field length is > maximum */
  1146. #define JET_errColumnNotFound -1507 /* No such column */
  1147. #define JET_errColumnDuplicate -1508 /* Field is already defined */
  1148. #define JET_errColumnRedundant -1510 /* Second autoincrement or version column */
  1149. #define JET_errInvalidColumnType -1511 /* Invalid column data type */
  1150. #define JET_wrnColumnMaxTruncated 1512 /* Max length too big, truncated */
  1151. #define JET_errTaggedNotNULL -1514 /* No non-NULL tagged columns */
  1152. #define JET_errNoCurrentIndex -1515 /* Invalid w/o a current index */
  1153. #define JET_errKeyIsMade -1516 /* The key is completely made */
  1154. #define JET_errBadColumnId -1517 /* Column Id Incorrect */
  1155. #define JET_errBadItagSequence -1518 /* Bad itagSequence for tagged column */
  1156. #define JET_errColumnInRelationship -1519 /* Cannot delete, column participates in relationship */
  1157. #define JET_wrnCopyLongValue 1520 /* Single instance column bursted */
  1158. #define JET_errCannotBeTagged -1521 /* AutoIncrement and Version cannot be tagged */
  1159. #define wrnLVNoLongValues 1522 /* Table does not have a long value tree */
  1160. #define JET_wrnTaggedColumnsRemaining 1523 /* RetrieveTaggedColumnList ran out of copy buffer before retrieving all tagged columns */
  1161. #define JET_errDefaultValueTooBig -1524 /* Default value exceeds maximum size */
  1162. #define JET_errMultiValuedDuplicate -1525 /* Duplicate detected on a unique multi-valued column */
  1163. #define JET_errLVCorrupted -1526 /* Corruption encountered in long-value tree */
  1164. #define wrnLVNoMoreData 1527 /* Reached end of LV data */
  1165. #define JET_errRecordNotFound -1601 /* The key was not found */
  1166. #define JET_errRecordNoCopy -1602 /* No working buffer */
  1167. #define JET_errNoCurrentRecord -1603 /* Currency not on a record */
  1168. #define JET_errRecordPrimaryChanged -1604 /* Primary key may not change */
  1169. #define JET_errKeyDuplicate -1605 /* Illegal duplicate key */
  1170. #define JET_errAlreadyPrepared -1607 /* Already copy/clear current */
  1171. #define JET_errKeyNotMade -1608 /* No call to JetMakeKey */
  1172. #define JET_errUpdateNotPrepared -1609 /* No call to JetPrepareUpdate */
  1173. #define JET_wrnDataHasChanged 1610 /* Data has changed */
  1174. #define JET_errDataHasChanged -1611 /* Data has changed, operation aborted */
  1175. #define JET_wrnKeyChanged 1618 /* Moved to new key */
  1176. #define JET_errLanguageNotSupported -1619 /* WindowsNT installation does not support language */
  1177. #define JET_errTooManySorts -1701 /* Too many sort processes */
  1178. #define JET_errInvalidOnSort -1702 /* Invalid operation on Sort */
  1179. #define JET_errTempFileOpenError -1803 /* Temp file could not be opened */
  1180. #define JET_errTooManyAttachedDatabases -1805 /* Too many open databases */
  1181. #define JET_errDiskFull -1808 /* No space left on disk */
  1182. #define JET_errPermissionDenied -1809 /* Permission denied */
  1183. #define JET_errFileNotFound -1811 /* File not found */
  1184. #define JET_wrnFileOpenReadOnly 1813 /* Database file is read only */
  1185. #define JET_errAfterInitialization -1850 /* Cannot Restore after init. */
  1186. #define JET_errLogCorrupted -1852 /* Logs could not be interpreted */
  1187. #define JET_errInvalidOperation -1906 /* invalid operation */
  1188. #define JET_errAccessDenied -1907 /* access denied */
  1189. #define JET_wrnIdleFull 1908 /* ilde registry full */
  1190. #define JET_errTooManySplits -1909 /* Infinite split. Call PSS */
  1191. #define JET_errSessionSharingViolation -1910 /* Multiple threads are using the same session */
  1192. #define JET_errEntryPointNotFound -1911 /* An entry point in a DLL we require could not be found */
  1193. #define JET_wrnDefragAlreadyRunning 2000 /* Online defrag already running on specified database */
  1194. #define JET_wrnDefragNotRunning 2001 /* Online defrag not running on specified database */
  1195. /**********************************************************************/
  1196. /*********************** PROTOTYPES **************************/
  1197. /**********************************************************************/
  1198. #if !defined(_JET_NOPROTOTYPES)
  1199. #ifdef __cplusplus
  1200. extern "C" {
  1201. #endif
  1202. JET_ERR JET_API JetInit( JET_INSTANCE *pinstance );
  1203. JET_ERR JET_API JetTerm( JET_INSTANCE instance );
  1204. JET_ERR JET_API JetTerm2( JET_INSTANCE instance, JET_GRBIT grbit );
  1205. JET_ERR JET_API JetStopService();
  1206. JET_ERR JET_API JetStopBackup();
  1207. JET_ERR JET_API JetSetSystemParameter(
  1208. JET_INSTANCE *pinstance,
  1209. JET_SESID sesid,
  1210. unsigned long paramid,
  1211. ULONG_PTR lParam,
  1212. const char *sz );
  1213. JET_ERR JET_API JetGetSystemParameter(
  1214. JET_INSTANCE instance,
  1215. JET_SESID sesid,
  1216. unsigned long paramid,
  1217. ULONG_PTR *plParam,
  1218. char *sz,
  1219. unsigned long cbMax );
  1220. JET_ERR JET_API JetResetCounter( JET_SESID sesid, long CounterType );
  1221. JET_ERR JET_API JetGetCounter( JET_SESID sesid, long CounterType, long *plValue );
  1222. JET_ERR JET_API JetBeginSession(
  1223. JET_INSTANCE instance,
  1224. JET_SESID *psesid,
  1225. const char *szUserName,
  1226. const char *szPassword );
  1227. JET_ERR JET_API JetDupSession( JET_SESID sesid, JET_SESID *psesid );
  1228. JET_ERR JET_API JetEndSession( JET_SESID sesid, JET_GRBIT grbit );
  1229. JET_ERR JET_API JetGetVersion( JET_SESID sesid, unsigned long *pwVersion );
  1230. JET_ERR JET_API JetIdle( JET_SESID sesid, JET_GRBIT grbit );
  1231. JET_ERR JET_API JetCreateDatabase(
  1232. JET_SESID sesid,
  1233. const char *szFilename,
  1234. const char *szConnect,
  1235. JET_DBID *pdbid,
  1236. JET_GRBIT grbit );
  1237. JET_ERR JET_API JetCreateDatabase2(
  1238. JET_SESID sesid,
  1239. const char *szFilename,
  1240. const unsigned long cpgDatabaseSizeMax,
  1241. JET_DBID *pdbid,
  1242. JET_GRBIT grbit );
  1243. JET_ERR JET_API JetAttachDatabase(
  1244. JET_SESID sesid,
  1245. const char *szFilename,
  1246. JET_GRBIT grbit );
  1247. JET_ERR JET_API JetAttachDatabase2(
  1248. JET_SESID sesid,
  1249. const char *szFilename,
  1250. const unsigned long cpgDatabaseSizeMax,
  1251. JET_GRBIT grbit );
  1252. JET_ERR JET_API JetDetachDatabase(
  1253. JET_SESID sesid,
  1254. const char *szFilename );
  1255. JET_ERR JET_API JetGetObjectInfo(
  1256. JET_SESID sesid,
  1257. JET_DBID dbid,
  1258. JET_OBJTYP objtyp,
  1259. const char *szContainerName,
  1260. const char *szObjectName,
  1261. void *pvResult,
  1262. unsigned long cbMax,
  1263. unsigned long InfoLevel );
  1264. JET_ERR JET_API JetGetTableInfo(
  1265. JET_SESID sesid,
  1266. JET_TABLEID tableid,
  1267. void *pvResult,
  1268. unsigned long cbMax,
  1269. unsigned long InfoLevel );
  1270. JET_ERR JET_API JetCreateTable(
  1271. JET_SESID sesid,
  1272. JET_DBID dbid,
  1273. const char *szTableName,
  1274. unsigned long lPages,
  1275. unsigned long lDensity,
  1276. JET_TABLEID *ptableid );
  1277. JET_ERR JET_API JetCreateTableColumnIndex(
  1278. JET_SESID sesid,
  1279. JET_DBID dbid,
  1280. JET_TABLECREATE *ptablecreate );
  1281. JET_ERR JET_API JetDeleteTable(
  1282. JET_SESID sesid,
  1283. JET_DBID dbid,
  1284. const char *szTableName );
  1285. JET_ERR JET_API JetRenameTable(
  1286. JET_SESID sesid,
  1287. JET_DBID dbid,
  1288. const char *szName,
  1289. const char *szNameNew );
  1290. JET_ERR JET_API JetGetTableColumnInfo(
  1291. JET_SESID sesid,
  1292. JET_TABLEID tableid,
  1293. const char *szColumnName,
  1294. void *pvResult,
  1295. unsigned long cbMax,
  1296. unsigned long InfoLevel );
  1297. JET_ERR JET_API JetGetColumnInfo(
  1298. JET_SESID sesid,
  1299. JET_DBID dbid,
  1300. const char *szTableName,
  1301. const char *szColumnName,
  1302. void *pvResult,
  1303. unsigned long cbMax,
  1304. unsigned long InfoLevel );
  1305. JET_ERR JET_API JetAddColumn(
  1306. JET_SESID sesid,
  1307. JET_TABLEID tableid,
  1308. const char *szColumnName,
  1309. const JET_COLUMNDEF *pcolumndef,
  1310. const void *pvDefault,
  1311. unsigned long cbDefault,
  1312. JET_COLUMNID *pcolumnid );
  1313. JET_ERR JET_API JetDeleteColumn(
  1314. JET_SESID sesid,
  1315. JET_TABLEID tableid,
  1316. const char *szColumnName );
  1317. JET_ERR JET_API JetSetColumnDefaultValue(
  1318. JET_SESID sesid,
  1319. JET_DBID dbid,
  1320. const char *szTableName,
  1321. const char *szColumnName,
  1322. const void *pvData,
  1323. const unsigned long cbData,
  1324. const JET_GRBIT grbit );
  1325. JET_ERR JET_API JetGetTableIndexInfo(
  1326. JET_SESID sesid,
  1327. JET_TABLEID tableid,
  1328. const char *szIndexName,
  1329. void *pvResult,
  1330. unsigned long cbResult,
  1331. unsigned long InfoLevel );
  1332. JET_ERR JET_API JetGetIndexInfo(
  1333. JET_SESID sesid,
  1334. JET_DBID dbid,
  1335. const char *szTableName,
  1336. const char *szIndexName,
  1337. void *pvResult,
  1338. unsigned long cbResult,
  1339. unsigned long InfoLevel );
  1340. JET_ERR JET_API JetCreateIndex(
  1341. JET_SESID sesid,
  1342. JET_TABLEID tableid,
  1343. const char *szIndexName,
  1344. JET_GRBIT grbit,
  1345. const char *szKey,
  1346. unsigned long cbKey,
  1347. unsigned long lDensity );
  1348. JET_ERR JET_API JetCreateIndex2(
  1349. JET_SESID sesid,
  1350. JET_TABLEID tableid,
  1351. JET_INDEXCREATE *pindexcreate,
  1352. unsigned long cIndexCreate );
  1353. JET_ERR JET_API JetDeleteIndex(
  1354. JET_SESID sesid,
  1355. JET_TABLEID tableid,
  1356. const char *szIndexName );
  1357. JET_ERR JET_API JetBeginTransaction( JET_SESID sesid );
  1358. JET_ERR JET_API JetCommitTransaction( JET_SESID sesid, JET_GRBIT grbit );
  1359. JET_ERR JET_API JetRollback( JET_SESID sesid, JET_GRBIT grbit );
  1360. JET_ERR JET_API JetGetDatabaseInfo(
  1361. JET_SESID sesid,
  1362. JET_DBID dbid,
  1363. void *pvResult,
  1364. unsigned long cbMax,
  1365. unsigned long InfoLevel );
  1366. JET_ERR JET_API JetGetDatabaseFileInfo(
  1367. const char *szDatabaseName,
  1368. void *pvResult,
  1369. unsigned long cbMax,
  1370. unsigned long InfoLevel );
  1371. JET_ERR JET_API JetOpenDatabase(
  1372. JET_SESID sesid,
  1373. const char *szFilename,
  1374. const char *szConnect,
  1375. JET_DBID *pdbid,
  1376. JET_GRBIT grbit );
  1377. JET_ERR JET_API JetCloseDatabase(
  1378. JET_SESID sesid,
  1379. JET_DBID dbid,
  1380. JET_GRBIT grbit );
  1381. JET_ERR JET_API JetOpenTable(
  1382. JET_SESID sesid,
  1383. JET_DBID dbid,
  1384. const char *szTableName,
  1385. const void *pvParameters,
  1386. unsigned long cbParameters,
  1387. JET_GRBIT grbit,
  1388. JET_TABLEID *ptableid );
  1389. JET_ERR JET_API JetCloseTable( JET_SESID sesid, JET_TABLEID tableid );
  1390. JET_ERR JET_API JetDelete( JET_SESID sesid, JET_TABLEID tableid );
  1391. JET_ERR JET_API JetUpdate(
  1392. JET_SESID sesid,
  1393. JET_TABLEID tableid,
  1394. void *pvBookmark,
  1395. unsigned long cbBookmark,
  1396. unsigned long *pcbActual);
  1397. JET_ERR JET_API JetEscrowUpdate(
  1398. JET_SESID sesid,
  1399. JET_TABLEID tableid,
  1400. JET_COLUMNID columnid,
  1401. void *pv,
  1402. unsigned long cbMax,
  1403. void *pvOld,
  1404. unsigned long cbOldMax,
  1405. unsigned long *pcbOldActual,
  1406. JET_GRBIT grbit );
  1407. JET_ERR JET_API JetRetrieveColumn(
  1408. JET_SESID sesid,
  1409. JET_TABLEID tableid,
  1410. JET_COLUMNID columnid,
  1411. void *pvData,
  1412. unsigned long cbData,
  1413. unsigned long *pcbActual,
  1414. JET_GRBIT grbit,
  1415. JET_RETINFO *pretinfo );
  1416. JET_ERR JET_API JetRetrieveColumns(
  1417. JET_SESID sesid,
  1418. JET_TABLEID tableid,
  1419. JET_RETRIEVECOLUMN *pretrievecolumn,
  1420. unsigned long cretrievecolumn );
  1421. JET_ERR JET_API JetRetrieveTaggedColumnList(
  1422. JET_SESID sesid,
  1423. JET_TABLEID tableid,
  1424. unsigned long *pcColumns,
  1425. void *pvData,
  1426. unsigned long cbData,
  1427. JET_COLUMNID columnidStart,
  1428. JET_GRBIT grbit );
  1429. JET_ERR JET_API JetSetColumn(
  1430. JET_SESID sesid,
  1431. JET_TABLEID tableid,
  1432. JET_COLUMNID columnid,
  1433. const void *pvData,
  1434. unsigned long cbData,
  1435. JET_GRBIT grbit,
  1436. JET_SETINFO *psetinfo );
  1437. JET_ERR JET_API JetSetColumns(
  1438. JET_SESID sesid,
  1439. JET_TABLEID tableid,
  1440. JET_SETCOLUMN *psetcolumn,
  1441. unsigned long csetcolumn );
  1442. JET_ERR JET_API JetPrepareUpdate(
  1443. JET_SESID sesid,
  1444. JET_TABLEID tableid,
  1445. unsigned long prep );
  1446. JET_ERR JET_API JetGetRecordPosition(
  1447. JET_SESID sesid,
  1448. JET_TABLEID tableid,
  1449. JET_RECPOS *precpos,
  1450. unsigned long cbRecpos );
  1451. JET_ERR JET_API JetGotoPosition(
  1452. JET_SESID sesid,
  1453. JET_TABLEID tableid,
  1454. JET_RECPOS *precpos );
  1455. JET_ERR JET_API JetGetCursorInfo(
  1456. JET_SESID sesid,
  1457. JET_TABLEID tableid,
  1458. void *pvResult,
  1459. unsigned long cbMax,
  1460. unsigned long InfoLevel );
  1461. JET_ERR JET_API JetDupCursor(
  1462. JET_SESID sesid,
  1463. JET_TABLEID tableid,
  1464. JET_TABLEID *ptableid,
  1465. JET_GRBIT grbit );
  1466. JET_ERR JET_API JetGetCurrentIndex(
  1467. JET_SESID sesid,
  1468. JET_TABLEID tableid,
  1469. char *szIndexName,
  1470. unsigned long cchIndexName );
  1471. JET_ERR JET_API JetSetCurrentIndex(
  1472. JET_SESID sesid,
  1473. JET_TABLEID tableid,
  1474. const char *szIndexName );
  1475. JET_ERR JET_API JetSetCurrentIndex2(
  1476. JET_SESID sesid,
  1477. JET_TABLEID tableid,
  1478. const char *szIndexName,
  1479. JET_GRBIT grbit );
  1480. JET_ERR JET_API JetSetCurrentIndex3(
  1481. JET_SESID sesid,
  1482. JET_TABLEID tableid,
  1483. const char *szIndexName,
  1484. JET_GRBIT grbit,
  1485. unsigned long itagSequence );
  1486. JET_ERR JET_API JetMove(
  1487. JET_SESID sesid,
  1488. JET_TABLEID tableid,
  1489. long cRow,
  1490. JET_GRBIT grbit );
  1491. JET_ERR JET_API JetGetLock(
  1492. JET_SESID sesid,
  1493. JET_TABLEID tableid,
  1494. JET_GRBIT grbit );
  1495. JET_ERR JET_API JetMakeKey(
  1496. JET_SESID sesid,
  1497. JET_TABLEID tableid,
  1498. const void *pvData,
  1499. unsigned long cbData,
  1500. JET_GRBIT grbit );
  1501. JET_ERR JET_API JetSeek(
  1502. JET_SESID sesid,
  1503. JET_TABLEID tableid,
  1504. JET_GRBIT grbit );
  1505. JET_ERR JET_API JetGetBookmark(
  1506. JET_SESID sesid,
  1507. JET_TABLEID tableid,
  1508. void *pvBookmark,
  1509. unsigned long cbMax,
  1510. unsigned long *pcbActual );
  1511. JET_ERR JET_API JetCompact(
  1512. JET_SESID sesid,
  1513. const char *szDatabaseSrc,
  1514. const char *szDatabaseDest,
  1515. JET_PFNSTATUS pfnStatus,
  1516. JET_CONVERT *pconvert,
  1517. JET_GRBIT grbit );
  1518. JET_ERR JET_API JetDefragment(
  1519. JET_SESID sesid,
  1520. JET_DBID dbid,
  1521. const char *szTableName,
  1522. unsigned long *pcPasses,
  1523. unsigned long *pcSeconds,
  1524. JET_GRBIT grbit );
  1525. JET_ERR JET_API JetSetDatabaseSize(
  1526. JET_SESID sesid,
  1527. const char *szDatabaseName,
  1528. unsigned long cpg,
  1529. unsigned long *pcpgReal );
  1530. JET_ERR JET_API JetGrowDatabase(
  1531. JET_SESID sesid,
  1532. JET_DBID dbid,
  1533. unsigned long cpg,
  1534. unsigned long *pcpgReal );
  1535. JET_ERR JET_API JetDBUtilities( JET_DBUTIL *pdbutil );
  1536. JET_ERR JET_API JetGotoBookmark(
  1537. JET_SESID sesid,
  1538. JET_TABLEID tableid,
  1539. void *pvBookmark,
  1540. unsigned long cbBookmark );
  1541. JET_ERR JET_API JetComputeStats( JET_SESID sesid, JET_TABLEID tableid );
  1542. typedef ULONG_PTR JET_VSESID; /* Received from dispatcher */
  1543. struct tagVDBFNDEF;
  1544. typedef ULONG_PTR JET_VDBID; /* Received from dispatcher */
  1545. struct tagVTFNDEF;
  1546. typedef ULONG_PTR JET_VTID; /* Received from dispatcher */
  1547. JET_ERR JET_API JetOpenTempTable(JET_SESID sesid,
  1548. const JET_COLUMNDEF *prgcolumndef, unsigned long ccolumn,
  1549. JET_GRBIT grbit, JET_TABLEID *ptableid,
  1550. JET_COLUMNID *prgcolumnid);
  1551. JET_ERR JET_API JetOpenTempTable2(
  1552. JET_SESID sesid,
  1553. const JET_COLUMNDEF *prgcolumndef,
  1554. unsigned long ccolumn,
  1555. unsigned long lcid,
  1556. JET_GRBIT grbit,
  1557. JET_TABLEID *ptableid,
  1558. JET_COLUMNID *prgcolumnid );
  1559. JET_ERR JET_API JetBackup( const char *szBackupPath, JET_GRBIT grbit, JET_PFNSTATUS pfnStatus );
  1560. JET_ERR JET_API JetRestore(const char *sz, JET_PFNSTATUS pfn );
  1561. JET_ERR JET_API JetRestore2(const char *sz, const char *szDest, JET_PFNSTATUS pfn );
  1562. JET_ERR JET_API JetSetIndexRange(JET_SESID sesid,
  1563. JET_TABLEID tableidSrc, JET_GRBIT grbit);
  1564. JET_ERR JET_API JetIndexRecordCount(JET_SESID sesid,
  1565. JET_TABLEID tableid, unsigned long *pcrec, unsigned long crecMax );
  1566. JET_ERR JET_API JetRetrieveKey(JET_SESID sesid,
  1567. JET_TABLEID tableid, void *pvData, unsigned long cbMax,
  1568. unsigned long *pcbActual, JET_GRBIT grbit );
  1569. JET_ERR JET_API JetBeginExternalBackup( JET_GRBIT grbit );
  1570. JET_ERR JET_API JetGetAttachInfo( void *pv,
  1571. unsigned long cbMax,
  1572. unsigned long *pcbActual );
  1573. JET_ERR JET_API JetOpenFile( const char *szFileName,
  1574. JET_HANDLE *phfFile,
  1575. unsigned long *pulFileSizeLow,
  1576. unsigned long *pulFileSizeHigh );
  1577. JET_ERR JET_API JetReadFile( JET_HANDLE hfFile,
  1578. void *pv,
  1579. unsigned long cb,
  1580. unsigned long *pcb );
  1581. JET_ERR JET_API JetAsyncReadFile(
  1582. JET_HANDLE hfFile,
  1583. void* pv,
  1584. unsigned long cb,
  1585. JET_OLP *pjolp
  1586. );
  1587. JET_ERR JET_API JetCheckAsyncReadFile( void *pv, int cb, unsigned long pgnoFirst );
  1588. JET_ERR JET_API JetCloseFile( JET_HANDLE hfFile );
  1589. JET_ERR JET_API JetGetLogInfo( void *pv,
  1590. unsigned long cbMax,
  1591. unsigned long *pcbActual );
  1592. JET_ERR JET_API JetTruncateLog( void );
  1593. JET_ERR JET_API JetEndExternalBackup( void );
  1594. JET_ERR JET_API JetExternalRestore( char *szCheckpointFilePath, char *szLogPath, JET_RSTMAP *rgstmap, long crstfilemap, char *szBackupLogPath, long genLow, long genHigh, JET_PFNSTATUS pfn );
  1595. #ifdef __cplusplus
  1596. }
  1597. #endif
  1598. #endif /* _JET_NOPROTOTYPES */
  1599. #include <poppack.h>
  1600. #ifdef __cplusplus
  1601. }
  1602. #endif
  1603. #endif /* _JET_INCLUDED */
  1604. #else /* _USE_NEW_JET_H_, the USE_NEW_JET_H is needed for err.awk to generate err.c in cli */
  1605. // *******************************************************************************
  1606. // Old Jet header...
  1607. // *******************************************************************************
  1608. #if !defined(_JET_INCLUDED)
  1609. #define _JET_INCLUDED
  1610. #ifdef __cplusplus
  1611. extern "C" {
  1612. #endif
  1613. #if defined(_M_ALPHA)
  1614. #include <pshpack8.h>
  1615. #else
  1616. #include <pshpack4.h>
  1617. #endif
  1618. #define JET_API __stdcall
  1619. #define JET_NODSAPI __stdcall
  1620. typedef long JET_ERR;
  1621. typedef unsigned long JET_INSTANCE; /* Instance Identifier */
  1622. typedef unsigned long JET_SESID; /* Session Identifier */
  1623. typedef unsigned long JET_TABLEID; /* Table Identifier */
  1624. typedef unsigned long JET_COLUMNID; /* Column Identifier */
  1625. typedef unsigned long JET_DBID; /* Database Identifier */
  1626. typedef unsigned long JET_OBJTYP; /* Object Type */
  1627. typedef unsigned long JET_COLTYP; /* Column Type */
  1628. typedef unsigned long JET_GRBIT; /* Group of Bits */
  1629. typedef unsigned long JET_ACM; /* Access Mask */
  1630. typedef unsigned long JET_RNT; /* Repair Notification Type */
  1631. typedef unsigned long JET_SNP; /* Status Notification Process */
  1632. typedef unsigned long JET_SNT; /* Status Notification Type */
  1633. typedef unsigned long JET_SNC; /* Status Notification Code */
  1634. typedef double JET_DATESERIAL; /* JET_coltypDateTime format */
  1635. typedef unsigned long JET_HANDLE; /* backup file handle */
  1636. typedef JET_ERR (__stdcall *JET_PFNSTATUS)(JET_SESID sesid, JET_SNP snp, JET_SNT snt, void *pv);
  1637. typedef struct tagCONVERT
  1638. {
  1639. char *szOldDll;
  1640. char *szOldSysDb;
  1641. unsigned long fDbAttached; // Return value indicating if Db was attached
  1642. } JET_CONVERT;
  1643. typedef enum
  1644. {
  1645. opDBUTILConsistency,
  1646. opDBUTILDumpData,
  1647. opDBUTILDumpMetaData,
  1648. opDBUTILDumpSpace,
  1649. opDBUTILDumpPage,
  1650. opDBUTILSetHeaderState,
  1651. opDBUTILDumpHeader,
  1652. opDBUTILDumpLogfile,
  1653. opDBUTILDumpCheckpoint,
  1654. opDBUTILEDBDump,
  1655. opDBUTILEDBRepair
  1656. } DBUTIL_OP;
  1657. typedef struct tagDBUTIL
  1658. {
  1659. unsigned long cbStruct;
  1660. char *szDatabase;
  1661. char *szTable;
  1662. char *szIndex;
  1663. DBUTIL_OP op;
  1664. JET_GRBIT grbitOptions;
  1665. } JET_DBUTIL;
  1666. #define JET_bitDBUtilOptionAllNodes 0x00000001
  1667. #define JET_bitDBUtilOptionKeyStats 0x00000002
  1668. #define JET_bitDBUtilOptionPageDump 0x00000004
  1669. #define JET_bitDBUtilOptionDumpVerbose 0x10000000 // DEBUG only
  1670. #define JET_bitDBUtilOptionCheckBTree 0x20000000 // DEBUG only
  1671. /* Session information bits */
  1672. #define JET_bitCIMCommitted 0x00000001
  1673. #define JET_bitCIMDirty 0x00000002
  1674. #define JET_bitAggregateTransaction 0x00000008
  1675. /* JetGetLastErrorInfo structure */
  1676. typedef struct
  1677. {
  1678. unsigned long cbStruct; /* Size of this structure */
  1679. JET_ERR err; /* Extended error code (if any) */
  1680. unsigned long ul1; /* First general purpose integer */
  1681. unsigned long ul2; /* Second general purpose integer */
  1682. unsigned long ul3; /* Third general purpose integer */
  1683. } JET_EXTERR;
  1684. /* Status Notification Structures */
  1685. typedef struct /* Status Notification Progress */
  1686. {
  1687. unsigned long cbStruct; /* Size of this structure */
  1688. unsigned long cunitDone; /* Number of units of work completed */
  1689. unsigned long cunitTotal; /* Total number of units of work */
  1690. } JET_SNPROG;
  1691. /* ErrCount Notification Structures */
  1692. typedef struct /* Status Notification Progress */
  1693. {
  1694. unsigned long cbStruct; /* Size of this structure */
  1695. unsigned long cRecUniqueKeyViolation;
  1696. unsigned long cRecTypeConversionFail;
  1697. unsigned long cRecRecordLocked;
  1698. unsigned long cRecTotal; /* Total number of units of work */
  1699. } JET_SNERRCNT;
  1700. typedef struct /* Status Notification Message */
  1701. {
  1702. unsigned long cbStruct; /* Size of this structure */
  1703. JET_SNC snc; /* Status Notification Code */
  1704. unsigned long ul; /* Numeric identifier */
  1705. char sz[256]; /* Identifier */
  1706. } JET_SNMSG;
  1707. typedef struct
  1708. {
  1709. unsigned long cbStruct;
  1710. JET_OBJTYP objtyp;
  1711. JET_DATESERIAL dtCreate;
  1712. JET_DATESERIAL dtUpdate;
  1713. JET_GRBIT grbit;
  1714. unsigned long flags;
  1715. unsigned long cRecord;
  1716. unsigned long cPage;
  1717. } JET_OBJECTINFO;
  1718. /* required for Exchange to make RSTMAP RPC capable
  1719. /**/
  1720. #ifdef MIDL_PASS
  1721. #define xRPC_STRING [string]
  1722. #else
  1723. #define xRPC_STRING
  1724. typedef unsigned short WCHAR;
  1725. #endif
  1726. typedef struct
  1727. {
  1728. xRPC_STRING char *szDatabaseName;
  1729. xRPC_STRING char *szNewDatabaseName;
  1730. } JET_RSTMAP; /* restore map */
  1731. /* required for Exchange unicode support
  1732. /**/
  1733. #define UNICODE_RSTMAP
  1734. typedef struct tagJET_RSTMAPW {
  1735. xRPC_STRING WCHAR *wszDatabaseName;
  1736. xRPC_STRING WCHAR *wszNewDatabaseName;
  1737. } JET_RSTMAPW, *PJET_RSTMAPW;
  1738. /* The following flags appear in the grbit field above */
  1739. #define JET_bitTableInfoUpdatable 0x00000001
  1740. #define JET_bitTableInfoBookmark 0x00000002
  1741. #define JET_bitTableInfoRollback 0x00000004
  1742. #define JET_bitTableInfoRestartable 0x00000008
  1743. #define JET_bitTableInfoNoInserts 0x00000010
  1744. /* The following flags occur in the flags field above */
  1745. #define JET_bitSaveUIDnPWD 0x20000000 /* this bit is only */
  1746. /* appropriate for rmt links */
  1747. #define JET_bitObjectExclusive 0x40000000 /* Open link exclusively */
  1748. #define JET_bitObjectSystem 0x80000000
  1749. typedef struct
  1750. {
  1751. unsigned long cbStruct;
  1752. JET_TABLEID tableid;
  1753. unsigned long cRecord;
  1754. JET_COLUMNID columnidcontainername;
  1755. JET_COLUMNID columnidobjectname;
  1756. JET_COLUMNID columnidobjtyp;
  1757. JET_COLUMNID columniddtCreate;
  1758. JET_COLUMNID columniddtUpdate;
  1759. JET_COLUMNID columnidgrbit;
  1760. JET_COLUMNID columnidflags;
  1761. JET_COLUMNID columnidcRecord; /* Level 2 info */
  1762. JET_COLUMNID columnidcPage; /* Level 2 info */
  1763. } JET_OBJECTLIST;
  1764. #define cObjectInfoCols 9
  1765. typedef struct
  1766. {
  1767. unsigned long cbStruct;
  1768. JET_TABLEID tableid;
  1769. unsigned long cRecord;
  1770. JET_COLUMNID columnidSid;
  1771. JET_COLUMNID columnidACM;
  1772. JET_COLUMNID columnidgrbit; /* grbit from JetSetAccess */
  1773. } JET_OBJECTACMLIST;
  1774. #define cObjectAcmCols 3
  1775. typedef struct
  1776. {
  1777. unsigned long cbStruct;
  1778. JET_TABLEID tableid;
  1779. unsigned long cRecord;
  1780. JET_COLUMNID columnidPresentationOrder;
  1781. JET_COLUMNID columnidcolumnname;
  1782. JET_COLUMNID columnidcolumnid;
  1783. JET_COLUMNID columnidcoltyp;
  1784. JET_COLUMNID columnidCountry;
  1785. JET_COLUMNID columnidLangid;
  1786. JET_COLUMNID columnidCp;
  1787. JET_COLUMNID columnidCollate;
  1788. JET_COLUMNID columnidcbMax;
  1789. JET_COLUMNID columnidgrbit;
  1790. JET_COLUMNID columnidDefault;
  1791. JET_COLUMNID columnidBaseTableName;
  1792. JET_COLUMNID columnidBaseColumnName;
  1793. JET_COLUMNID columnidDefinitionName;
  1794. } JET_COLUMNLIST;
  1795. #define cColumnInfoCols 14
  1796. typedef struct
  1797. {
  1798. unsigned long cbStruct;
  1799. JET_COLUMNID columnid;
  1800. JET_COLTYP coltyp;
  1801. unsigned short wCountry;
  1802. unsigned short langid;
  1803. unsigned short cp;
  1804. unsigned short wCollate; /* Must be 0 */
  1805. unsigned long cbMax;
  1806. JET_GRBIT grbit;
  1807. } JET_COLUMNDEF;
  1808. typedef struct
  1809. {
  1810. unsigned long cbStruct;
  1811. JET_COLUMNID columnid;
  1812. JET_COLTYP coltyp;
  1813. unsigned short wCountry;
  1814. unsigned short langid;
  1815. unsigned short cp;
  1816. unsigned short wFiller; /* Must be 0 */
  1817. unsigned long cbMax;
  1818. JET_GRBIT grbit;
  1819. char szBaseTableName[256];
  1820. char szBaseColumnName[256];
  1821. } JET_COLUMNBASE;
  1822. typedef struct
  1823. {
  1824. unsigned long cbStruct;
  1825. JET_TABLEID tableid;
  1826. unsigned long cRecord;
  1827. JET_COLUMNID columnidindexname;
  1828. JET_COLUMNID columnidgrbitIndex;
  1829. JET_COLUMNID columnidcKey;
  1830. JET_COLUMNID columnidcEntry;
  1831. JET_COLUMNID columnidcPage;
  1832. JET_COLUMNID columnidcColumn;
  1833. JET_COLUMNID columnidiColumn;
  1834. JET_COLUMNID columnidcolumnid;
  1835. JET_COLUMNID columnidcoltyp;
  1836. JET_COLUMNID columnidCountry;
  1837. JET_COLUMNID columnidLangid;
  1838. JET_COLUMNID columnidCp;
  1839. JET_COLUMNID columnidCollate;
  1840. JET_COLUMNID columnidgrbitColumn;
  1841. JET_COLUMNID columnidcolumnname;
  1842. } JET_INDEXLIST;
  1843. typedef struct tag_JET_COLUMNCREATE
  1844. {
  1845. unsigned long cbStruct; // size of this structure (for future expansion)
  1846. char *szColumnName; // column name
  1847. JET_COLTYP coltyp; // column type
  1848. unsigned long cbMax; // the maximum length of this column (only relevant for binary and text columns)
  1849. JET_GRBIT grbit; // column options
  1850. void *pvDefault; // default value (NULL if none)
  1851. unsigned long cbDefault; // length of default value
  1852. unsigned long cp; // code page (for text columns only)
  1853. JET_COLUMNID columnid; // returned column id
  1854. JET_ERR err; // returned error code
  1855. } JET_COLUMNCREATE;
  1856. typedef struct tagJET_INDEXCREATE
  1857. {
  1858. unsigned long cbStruct; // size of this structure (for future expansion)
  1859. char *szIndexName; // index name
  1860. char *szKey; // index key
  1861. unsigned long cbKey; // length of key
  1862. JET_GRBIT grbit; // index options
  1863. unsigned long ulDensity; // index density
  1864. JET_ERR err; // returned error code
  1865. } JET_INDEXCREATE;
  1866. typedef struct tagJET_TABLECREATE
  1867. {
  1868. unsigned long cbStruct; // size of this structure (for future expansion)
  1869. char *szTableName; // name of table to create.
  1870. unsigned long ulPages; // initial pages to allocate for table.
  1871. unsigned long ulDensity; // table density.
  1872. JET_COLUMNCREATE *rgcolumncreate; // array of column creation info
  1873. unsigned long cColumns; // number of columns to create
  1874. JET_INDEXCREATE *rgindexcreate; // array of index creation info
  1875. unsigned long cIndexes; // number of indexes to create
  1876. JET_GRBIT grbit; // Abort column/index creation on error?
  1877. JET_TABLEID tableid; // returned tableid.
  1878. unsigned long cCreated; // count of objects created (columns+table+indexes).
  1879. } JET_TABLECREATE;
  1880. #define cIndexInfoCols 15
  1881. typedef struct
  1882. {
  1883. unsigned long cbStruct;
  1884. JET_TABLEID tableid;
  1885. unsigned long cRecord;
  1886. JET_COLUMNID columnidReferenceName;
  1887. JET_COLUMNID columnidgrbit;
  1888. JET_COLUMNID columnidcColumn;
  1889. JET_COLUMNID columnidiColumn;
  1890. JET_COLUMNID columnidReferencingTableName;
  1891. JET_COLUMNID columnidReferencingColumnName;
  1892. JET_COLUMNID columnidReferencedTableName;
  1893. JET_COLUMNID columnidReferencedColumnName;
  1894. } JET_RELATIONSHIPLIST;
  1895. /* for backward compatibility */
  1896. typedef JET_RELATIONSHIPLIST JET_REFERENCELIST;
  1897. #define cReferenceInfoCols 8
  1898. typedef struct
  1899. {
  1900. unsigned long cbStruct;
  1901. unsigned long ibLongValue;
  1902. unsigned long itagSequence;
  1903. JET_COLUMNID columnidNextTagged;
  1904. } JET_RETINFO;
  1905. typedef struct
  1906. {
  1907. unsigned long cbStruct;
  1908. unsigned long ibLongValue;
  1909. unsigned long itagSequence;
  1910. } JET_SETINFO;
  1911. typedef struct
  1912. {
  1913. unsigned long cbStruct;
  1914. unsigned long centriesLT;
  1915. unsigned long centriesInRange;
  1916. unsigned long centriesTotal;
  1917. } JET_RECPOS;
  1918. typedef struct
  1919. {
  1920. unsigned long cDiscont;
  1921. unsigned long cUnfixedMessyPage;
  1922. unsigned long centriesLT;
  1923. unsigned long centriesTotal;
  1924. unsigned long cpgCompactFreed;
  1925. } JET_OLCSTAT;
  1926. typedef struct
  1927. {
  1928. unsigned long ctableid;
  1929. JET_TABLEID rgtableid[1];
  1930. } JET_MGBLIST;
  1931. /*** Property Manager Structure ***/
  1932. typedef struct
  1933. {
  1934. unsigned long cbStruct;
  1935. JET_TABLEID tableid;
  1936. JET_COLUMNID columnidColumnName;
  1937. JET_COLUMNID columnidPropertyName;
  1938. JET_COLUMNID columnidGrbit;
  1939. JET_COLUMNID columnidPropertyValue;
  1940. JET_COLUMNID columnidColtyp;
  1941. } JET_PROPERTYLIST;
  1942. /************************************************************************/
  1943. /************************* JET CONSTANTS ************************/
  1944. /************************************************************************/
  1945. #define JET_tableidNil ((JET_TABLEID) 0xFFFFFFFF)
  1946. #define JET_sesidNil ((JET_SESID) 0xFFFFFFFF)
  1947. /* Max size of a bookmark */
  1948. #define JET_cbBookmarkMost 4
  1949. /* Max length of a object/column/index/property name */
  1950. #define JET_cbNameMost 64
  1951. /* Max length of a "name.name.name..." construct */
  1952. #define JET_cbFullNameMost 255
  1953. /* Max size of long-value column chunk */
  1954. #define JET_cbColumnLVChunkMost 4035
  1955. /* Max size of non-long-value column data */
  1956. #define JET_cbColumnMost 255
  1957. /* Max size of a sort/index key */
  1958. #define JET_cbKeyMost 255
  1959. /* Max number of components in a sort/index key */
  1960. #define JET_ccolKeyMost 12
  1961. /* Max number of columns in a table/query */
  1962. #define JET_ccolTableMost 255
  1963. /* Max Length of a property in the property manager */
  1964. #define JET_cbPropertyMost 2048
  1965. /* Largest initial substring of a long value used in an expression */
  1966. #define JET_cbExprLVMost 0x8000L /*** 32 K ***/
  1967. /* Max size of returned (from SQLDriverConnect) conn string */
  1968. #define JET_cbConnectMost 255
  1969. /* Max number of levels in an MGB */
  1970. #define JET_wGroupLevelMax 12
  1971. /* Size restrictions for Pins */
  1972. #define JET_cchPINMax 20
  1973. #define JET_cchPINMin 4
  1974. /* System parameter codes for JetSetSystemParameter */
  1975. /* not supported */
  1976. #define JET_paramPfnStatus 2 /* Status callback function */
  1977. #define JET_paramPfnError 3 /* Error callback function */
  1978. #define JET_paramHwndODBC 4 /* Window handle for ODBC use */
  1979. #define JET_paramIniPath 5 /* Path to the ini file */
  1980. #define JET_paramPageTimeout 6 /* Red ISAM page timeout value */
  1981. #define JET_paramODBCQueryTimeout 7 /* ODBC async query timeout value */
  1982. #define JET_paramODBCLoginTimeout 25 /* ODBC connection attempt timeout value */
  1983. #define JET_paramExprObject 26 /* Expression Evaluation callback */
  1984. #define JET_paramGetTypeComp 27 /* Expression Evaluation callback */
  1985. #define JET_paramHostVersion 28 /* Host Version callback */
  1986. #define JET_paramSQLTraceMode 29 /* Enable/disable SQL tracing */
  1987. #define JET_paramEventId 46 /* NT event id */
  1988. #define JET_paramEventCategory 47 /* NT event category */
  1989. #define JET_paramRmtXactIsolation 39 /* Do not share connections with other sessions */
  1990. #define JET_paramJetInternal 35 /* Whether internal to JET; if set, allows ISAM to do things which are prevented in general */
  1991. #define JET_paramFullQJet 38 /* Allow full QJet functionality */
  1992. #define JET_paramLogFlushThreshold 18 /* log buffer flush threshold in 512 bytes [10] */
  1993. #define JET_paramLogFlushPeriod 22 /* log flush period in miliseconds [45] */
  1994. #define JET_paramOnLineCompact 37 /* Options for compact pages on-line */
  1995. #define JET_paramRecovery 30 /* Switch for log on/off */
  1996. /* debug only not supported */
  1997. #define JET_paramTransactionLevel 32 /* Transaction level of session */
  1998. #define JET_paramAssertAction 44 /* debug only determines action on assert */
  1999. #define JET_paramPrintFunction 49 /* debug only. synched print function */
  2000. #define JET_paramRFS2IOsPermitted 54 /* # IOs permitted to succeed (-1 = all) */
  2001. #define JET_paramRFS2AllocsPermitted 55 /* # allocs permitted to success (-1 = all) */
  2002. /* fully supported parameters */
  2003. /* Note that one page = 4kBytes.
  2004. /**/
  2005. #define JET_paramSysDbPath 0 /* path to the system database (defunct) ["<base name>.<base ext>"] */
  2006. #define JET_paramSystemPath 0 /* path to check point file ["."] */
  2007. #define JET_paramTempPath 1 /* path to the temporary database ["."] */
  2008. #define JET_paramMaxBuffers 8 /* maximum page cache size in pages [512] */
  2009. #define JET_paramMaxSessions 9 /* maximum number of sessions [128] */
  2010. #define JET_paramMaxOpenTables 10 /* maximum number of open tables [300] */
  2011. #define JET_paramPreferredMaxOpenTables 59 /* prefered maximum number of open tables [300] */
  2012. #define JET_paramMaxVerPages 11 /* maximum version store size in 16KB buckets [64] */
  2013. #define JET_paramMaxCursors 12 /* maximum number of open cursors [1024] */
  2014. #define JET_paramLogFilePath 13 /* path to the log file directory ["."] */
  2015. #define JET_paramMaxOpenTableIndexes 14 /* maximum open table indexes [300] */
  2016. #define JET_paramMaxTemporaryTables 15 /* maximum concurrent JetCreateIndex [20] */
  2017. #define JET_paramLogBuffers 16 /* maximum log buffers in 512 bytes [21] */
  2018. #define JET_paramLogFileSize 17 /* maximum log file size in kBytes [5120] */
  2019. #define JET_paramBfThrshldLowPrcnt 19 /* low percentage clean buffer flush start [20] */
  2020. #define JET_paramBfThrshldHighPrcnt 20 /* high percentage clean buffer flush stop [80] */
  2021. #define JET_paramWaitLogFlush 21 /* log flush wait time in milliseconds [15] */
  2022. #define JET_paramLogCheckpointPeriod 23 /* checkpoint period in 512 bytes [1024] */
  2023. #define JET_paramLogWaitingUserMax 24 /* maximum sessions waiting log flush [3] */
  2024. #define JET_paramSessionInfo 33 /* per session information [0] */
  2025. #define JET_paramPageFragment 34 /* maximum disk extent considered fragment in pages [8] */
  2026. #define JET_paramMaxOpenDatabases 36 /* maximum number of open databases [100] */
  2027. #define JET_paramBufBatchIOMax 41 /* maximum batch IO in pages [64] */
  2028. #define JET_paramPageReadAheadMax 42 /* maximum read-ahead IO in pages [20] */
  2029. #define JET_paramAsynchIOMax 43 /* maximum asynchronous IO in pages [64] */
  2030. #define JET_paramEventSource 45 /* language independant process descriptor string [""] */
  2031. #define JET_paramDbExtensionSize 48 /* database extension size in pages [16] */
  2032. #define JET_paramCommitDefault 50 /* default grbit for JetCommitTransaction [0] */
  2033. #define JET_paramBufLogGenAgeThreshold 51 /* age threshold in log files [2] */
  2034. #define JET_paramCircularLog 52 /* boolean flag for circular logging [0] */
  2035. #define JET_paramPageTempDBMin 53 /* minimum size temporary database in pages [0] */
  2036. #define JET_paramBaseName 56 /* base name for all DBMS object names ["edb"] */
  2037. #define JET_paramBaseExtension 57 /* base extension for all DBMS object names ["edb"] */
  2038. #define JET_paramTableClassName 58 /* table stats class name (class #, string) */
  2039. /* Flags for JetTerm2 */
  2040. #define JET_bitTermComplete 0x00000001
  2041. #define JET_bitTermAbrupt 0x00000002
  2042. /* Flags for JetIdle */
  2043. #define JET_bitIdleRemoveReadLocks 0x00000001
  2044. #define JET_bitIdleFlushBuffers 0x00000002
  2045. #define JET_bitIdleCompact 0x00000004
  2046. #define JET_bitIdleStatus 0x80000000
  2047. /* Flags for JetEndSession */
  2048. #define JET_bitForceSessionClosed 0x00000001
  2049. /* Flags for JetOpenDatabase */
  2050. #define JET_bitDbReadOnly 0x00000001
  2051. #define JET_bitDbExclusive 0x00000002 /* multiple opens allowed */
  2052. #define JET_bitDbRemoteSilent 0x00000004
  2053. #define JET_bitDbSingleExclusive 0x00000008 /* opened exactly once */
  2054. /* Flags for JetCloseDatabase */
  2055. #define JET_bitDbForceClose 0x00000001
  2056. /* Flags for JetCreateDatabase */
  2057. #define JET_bitDbVersion10 0x00000002 /* INTERNAL USE ONLY */
  2058. #define JET_bitDbVersion1x 0x00000004
  2059. #define JET_bitDbRecoveryOff 0x00000008 /* disable logging/recovery for this database */
  2060. #define JET_bitDbNoLogging JET_bitDbRecoveryOff
  2061. #define JET_bitDbCompleteConnstr 0x00000020
  2062. #define JET_bitDbVersioningOff 0x00000040
  2063. /* Flags for JetBackup */
  2064. #define JET_bitBackupIncremental 0x00000001
  2065. #define JET_bitKeepOldLogs 0x00000002
  2066. #define JET_bitBackupAtomic 0x00000004
  2067. /* Database types */
  2068. #define JET_dbidNil ((JET_DBID) 0xFFFFFFFF)
  2069. #define JET_dbidNoValid ((JET_DBID) 0xFFFFFFFE) /* used as a flag to indicate that there is no valid dbid */
  2070. /* Flags for JetCreateLink */
  2071. /* Can use JET_bitObjectExclusive to cause linked to database to be opened */
  2072. /* exclusively. */
  2073. /* Flags for JetCreateTableColumnIndex */
  2074. #define JET_bitTableCreateCheckColumnNames 0x00000001 /* Ensures that each column
  2075. /* specified in the JET_COLUMNCREATE
  2076. /* array has a unique name
  2077. /* (for performance reasons,
  2078. /* the default is to NOT perform
  2079. /* this check and rely on the
  2080. /* function caller to ensure
  2081. /* column name uniqueness).
  2082. /**/
  2083. #define JET_bitTableCreateCompaction 0x40000000 /* Internal grbit used when
  2084. /* creating a table during
  2085. /* off-line compact.
  2086. /**/
  2087. #define JET_bitTableCreateSystemTable 0x80000000 /* Internal grbit used when
  2088. /* creating system tables.
  2089. /**/
  2090. /* Flags for JetAddColumn, JetGetColumnInfo, JetOpenTempTable */
  2091. #define JET_bitColumnFixed 0x00000001
  2092. #define JET_bitColumnTagged 0x00000002
  2093. #define JET_bitColumnNotNULL 0x00000004
  2094. #define JET_bitColumnVersion 0x00000008
  2095. #define JET_bitColumnAutoincrement 0x00000010
  2096. #define JET_bitColumnUpdatable 0x00000020 /* JetGetColumnInfo only */
  2097. #define JET_bitColumnTTKey 0x00000040 /* JetOpenTempTable only */
  2098. #define JET_bitColumnTTDescending 0x00000080 /* JetOpenTempTable only */
  2099. #define JET_bitColumnNotLast 0x00000100 /* Installable ISAM option */
  2100. #define JET_bitColumnRmtGraphic 0x00000200 /* JetGetColumnInfo */
  2101. #define JET_bitColumnMultiValued 0x00000400
  2102. #define JET_bitColumnColumnGUID 0x00000800
  2103. #define JET_bitColumnMostMany 0x00001000
  2104. #define JET_bitColumnPreventDelete 0x00002000
  2105. /* Flags for JetSetCurrentIndex */
  2106. #define JET_bitMoveFirst 0x00000000
  2107. #define JET_bitMoveBeforeFirst 0x00000001
  2108. #define JET_bitNoMove 0x00000002
  2109. /* Flags for JetMakeKey */
  2110. #define JET_bitNewKey 0x00000001
  2111. #define JET_bitStrLimit 0x00000002
  2112. #define JET_bitSubStrLimit 0x00000004
  2113. #define JET_bitNormalizedKey 0x00000008
  2114. #define JET_bitKeyDataZeroLength 0x00000010
  2115. #ifdef DBCS /* johnta: LIKE "ABC" not converted to ="ABC" for Japanese */
  2116. #define JET_bitLikeExtra1 0x00000020
  2117. #endif /* DBCS */
  2118. /* Flags for ErrDispSetIndexRange */
  2119. #define JET_bitRangeInclusive 0x00000001
  2120. #define JET_bitRangeUpperLimit 0x00000002
  2121. #define JET_bitRangeInstantDuration 0x00000004
  2122. #define JET_bitRangeRemove 0x00000008
  2123. /* Constants for JetMove */
  2124. #define JET_MoveFirst (0x80000000)
  2125. #define JET_MovePrevious (-1)
  2126. #define JET_MoveNext (+1)
  2127. #define JET_MoveLast (0x7fffffff)
  2128. /* Flags for JetMove */
  2129. #define JET_bitMoveKeyNE 0x00000001
  2130. #define JET_bitMoveCheckTS 0x00000002
  2131. #define JET_bitMoveInPage 0x00000004
  2132. /* Flags for JetSeek */
  2133. #define JET_bitSeekEQ 0x00000001
  2134. #define JET_bitSeekLT 0x00000002
  2135. #define JET_bitSeekLE 0x00000004
  2136. #define JET_bitSeekGE 0x00000008
  2137. #define JET_bitSeekGT 0x00000010
  2138. #define JET_bitSetIndexRange 0x00000020
  2139. /* Flags for JetFastFind */
  2140. #define JET_bitFFindBackwards 0x00000001
  2141. #define JET_bitFFindFromCursor 0x00000004
  2142. /* Flags for JetCreateIndex */
  2143. #define JET_bitIndexUnique 0x00000001
  2144. #define JET_bitIndexPrimary 0x00000002
  2145. #define JET_bitIndexDisallowNull 0x00000004
  2146. #define JET_bitIndexIgnoreNull 0x00000008
  2147. #define JET_bitIndexClustered 0x00000010
  2148. #define JET_bitIndexIgnoreAnyNull 0x00000020
  2149. #define JET_bitIndexIgnoreFirstNull 0x00000040
  2150. #define JET_bitIndexLazyFlush 0x00000080
  2151. #define JET_bitIndexEmpty 0x00000100 // don't attempt to build index, because all entries would evaluate to NULL (MUST also specify JET_bitIgnoreAnyNull)
  2152. #define JET_bitIndexEmptyTable 0x40000000 // Internal use only
  2153. #define JET_bitIndexReference 0x80000000 /* IndexInfo only */
  2154. /* Flags for index key definition */
  2155. #define JET_bitKeyAscending 0x00000000
  2156. #define JET_bitKeyDescending 0x00000001
  2157. /* Flags for JetCreateRelationship */
  2158. #define JET_bitRelationUnique 0x00000001
  2159. #define JET_bitRelationDontEnforce 0x00000002
  2160. #define JET_bitRelationInherited 0x00000004
  2161. #define JET_bitRelationTestLegal 0x00000008 /* don't create relationship */
  2162. #define JET_bitRelationshipMatchMask 0x000000F0
  2163. #define JET_bitRelationMatchDefault 0x00000000
  2164. #define JET_bitRelationMatchFull 0x00000010
  2165. #define JET_bitRelationUpdateActionMask 0x00000F00
  2166. #define JET_bitRelationUpdateDisallow 0x00000000
  2167. #define JET_bitRelationUpdateCascade 0x00000100
  2168. #define JET_bitRelationUpdateSetNull 0x00000200
  2169. #define JET_bitRelationUpdateSetDefault 0x00000300
  2170. #define JET_bitRelationDeleteActionMask 0x0000F000
  2171. #define JET_bitRelationDeleteDisallow 0x00000000
  2172. #define JET_bitRelationDeleteCascade 0x00001000
  2173. #define JET_bitRelationDeleteSetNull 0x00002000
  2174. #define JET_bitRelationDeleteSetDefault 0x00003000
  2175. #define JET_bitRelationUserMask 0xFF000000 /* non-enforced values */
  2176. #define JET_bitRelationJoinMask 0x03000000
  2177. #define JET_bitRelationInner 0x00000000
  2178. #define JET_bitRelationLeft 0x01000000
  2179. #define JET_bitRelationRight 0x02000000
  2180. /* Flags for JetCreateReference/JetCreateRelationship */
  2181. /* NOTE: use the bitRelationship flags instead! */
  2182. #define JET_ReferenceUnique JET_bitRelationUnique
  2183. #define JET_ReferenceDontEnforce JET_bitRelationDontEnforce
  2184. #define JET_ReferenceMatchTypeMask JET_bitRelationMatchMask
  2185. #define JET_ReferenceMatchDefault JET_bitRelationMatchDefault
  2186. #define JET_ReferenceMatchFull JET_bitRelationMatchFull
  2187. #define JET_ReferenceUpdateActionMask JET_bitRelationUpdateActionMask
  2188. #define JET_ReferenceUpdateDisallow JET_bitRelationUpdateDisallow
  2189. #define JET_ReferenceUpdateCascade JET_bitRelationUpdateCascade
  2190. #define JET_ReferenceUpdateSetNull JET_bitRelationUpdateSetNull
  2191. #define JET_ReferenceUpdateSetDefault JET_bitRelationUpdateSetDefault
  2192. #define JET_ReferenceDeleteActionMask JET_bitRelationDeleteActionMask
  2193. #define JET_ReferenceDeleteDisallow JET_bitRelationDeleteDisallow
  2194. #define JET_ReferenceDeleteCascade JET_bitRelationDeleteCascade
  2195. #define JET_ReferenceDeleteSetNull JET_bitRelationDeleteSetNull
  2196. #define JET_ReferenceDeleteSetDefault JET_bitRelationDeleteSetDefault
  2197. /* Flags for JetOpenTable */
  2198. #define JET_bitTableDenyWrite 0x00000001
  2199. #define JET_bitTableDenyRead 0x00000002
  2200. #define JET_bitTableReadOnly 0x00000004
  2201. #define JET_bitTableAppendOnly 0x00000008
  2202. #define JET_bitTableUpdatable 0x00000010
  2203. #define JET_bitTableScrollable 0x00000020
  2204. #define JET_bitTableFixedSet 0x00000040 /* Fixed working set */
  2205. #define JET_bitTableInconsistent 0x00000080
  2206. #define JET_bitTableBulk 0x00000100
  2207. #define JET_bitTableUsePrimaryIndex 0x00000200 /* Use with FixedSet */
  2208. #define JET_bitTableSampleData 0x00000400
  2209. #define JET_bitTableQuickBrowse 0x00000800 /* Bias optimizer toward index usage */
  2210. #define JET_bitTableDDL 0x00001000 /* similar to JET_bitTableBulk, for DDL */
  2211. #define JET_bitTablePassThrough 0x00002000 /* Remote DBs Only */
  2212. #define JET_bitTableRowReturning 0x00004000
  2213. #define JET_bitTableSequential 0x00008000 /* Intend to access table sequentially */
  2214. #define JET_bitTableClassMask 0x000F0000 /* table stats class mask */
  2215. #define JET_bitTableClassNone 0x00000000 /* table belongs to no stats class (default) */
  2216. #define JET_bitTableClass1 0x00010000 /* table belongs to stats class 1 */
  2217. #define JET_bitTableClass2 0x00020000 /* table belongs to stats class 2 */
  2218. #define JET_bitTableClass3 0x00030000 /* table belongs to stats class 3 */
  2219. #define JET_bitTableClass4 0x00040000 /* table belongs to stats class 4 */
  2220. #define JET_bitTableClass5 0x00050000 /* table belongs to stats class 5 */
  2221. #define JET_bitTableClass6 0x00060000 /* table belongs to stats class 6 */
  2222. #define JET_bitTableClass7 0x00070000 /* table belongs to stats class 7 */
  2223. #define JET_bitTableClass8 0x00080000 /* table belongs to stats class 8 */
  2224. #define JET_bitTableClass9 0x00090000 /* table belongs to stats class 9 */
  2225. #define JET_bitTableClass10 0x000A0000 /* table belongs to stats class 10 */
  2226. #define JET_bitTableClass11 0x000B0000 /* table belongs to stats class 11 */
  2227. #define JET_bitTableClass12 0x000C0000 /* table belongs to stats class 12 */
  2228. #define JET_bitTableClass13 0x000D0000 /* table belongs to stats class 13 */
  2229. #define JET_bitTableClass14 0x000E0000 /* table belongs to stats class 14 */
  2230. #define JET_bitTableClass15 0x000F0000 /* table belongs to stats class 15 */
  2231. /* Flags for JetSetQoSql/JetRetrieveQoSql */
  2232. #define JET_bitSqlPassThrough 0x00000001 /* Pass through Query returning records */
  2233. #define JET_bitSqlSPTBulkOp 0x00000002 /* SPT query returning no table */
  2234. /* Flags for JetOpenVtQbe */
  2235. #define JET_bitQBEAddBrackets 0x00000001
  2236. #define JET_bitQBERemoveEquals 0x00000002
  2237. /* Flags for JetOpenTempTable and ErrIsamOpenTempTable */
  2238. #define JET_bitTTIndexed 0x00000001 /* Allow seek */
  2239. #define JET_bitTTUnique 0x00000002 /* Remove duplicates -- OBSOLETE: Dupes are ALWAYS either silently removed or an error is returned on insertion */
  2240. #define JET_bitTTUpdatable 0x00000004 /* Allow updates */
  2241. #define JET_bitTTScrollable 0x00000008 /* Allow backwards scrolling */
  2242. /* Flags for JetSetColumn */
  2243. #define JET_bitSetAppendLV 0x00000001
  2244. #define JET_bitSetValidate 0x00000002
  2245. #define JET_bitSetOverwriteLV 0x00000004 /* overwrite JET_coltypLong* byte range */
  2246. #define JET_bitSetSizeLV 0x00000008 /* set JET_coltypLong* size */
  2247. #define JET_bitSetValidateColumn 0x00000010
  2248. #define JET_bitSetZeroLength 0x00000020
  2249. #define JET_bitSetSeparateLV 0x00000040 /* force LV separation */
  2250. #define JET_bitSetNoVersion 0x00000080 /* INTERNAL USE ONLY */
  2251. /* Set column parameter structure for JetSetColumns */
  2252. typedef struct {
  2253. JET_COLUMNID columnid;
  2254. const void *pvData;
  2255. unsigned long cbData;
  2256. JET_GRBIT grbit;
  2257. unsigned long ibLongValue;
  2258. unsigned long itagSequence;
  2259. JET_ERR err;
  2260. } JET_SETCOLUMN;
  2261. /* Options for JetPrepareUpdate */
  2262. #define JET_prepInsert 0
  2263. #define JET_prepInsertBeforeCurrent 1
  2264. #define JET_prepReplace 2
  2265. #define JET_prepCancel 3
  2266. #define JET_prepReplaceNoLock 4
  2267. #define JET_prepInsertCopy 5
  2268. /* Flags for JetRetrieveColumn */
  2269. #define JET_bitRetrieveCopy 0x00000001
  2270. #define JET_bitRetrieveFromIndex 0x00000002
  2271. #define JET_bitRetrieveCase 0x00000004
  2272. #define JET_bitRetrieveTag 0x00000008
  2273. #define JET_bitRetrieveNull 0x00000010 /* for columnid 0 only */
  2274. #define JET_bitRetrieveIgnoreDefault 0x00000020 /* for columnid 0 only */
  2275. #define JET_bitRetrieveLongId 0x00000040
  2276. #define JET_bitRetrieveRecord 0x80000000
  2277. #define JET_bitRetrieveFDB 0x40000000
  2278. #define JET_bitRetrieveBookmarks 0x20000000
  2279. /* Retrieve column parameter structure for JetRetrieveColumns */
  2280. typedef struct {
  2281. JET_COLUMNID columnid;
  2282. void *pvData;
  2283. unsigned long cbData;
  2284. unsigned long cbActual;
  2285. JET_GRBIT grbit;
  2286. unsigned long ibLongValue;
  2287. unsigned long itagSequence;
  2288. JET_COLUMNID columnidNextTagged;
  2289. JET_ERR err;
  2290. } JET_RETRIEVECOLUMN;
  2291. /* Flags for JetFillFatCursor */
  2292. #define JET_bitFCFillRange 0x00000001
  2293. #define JET_bitFCRefreshRange 0x00000002
  2294. #define JET_bitFCFillMemos 0x00000004
  2295. /* Flags for JetCommitTransaction */
  2296. #define JET_bitCommitFlush 0x00000001 /* commit and flush page buffers. */
  2297. #define JET_bitCommitLazyFlush 0x00000004 /* lazy flush log buffers. */
  2298. #define JET_bitWaitLastLevel0Commit 0x00000010 /* wait for last level 0 commit record flushed */
  2299. /* Flags for JetRollback */
  2300. #define JET_bitRollbackAll 0x00000001
  2301. /* Flags for JetSetAccess and JetGetAccess */
  2302. #define JET_bitACEInheritable 0x00000001
  2303. /* Flags for JetCreateSystemDatabase */
  2304. #define JET_bitSysDbOverwrite 0x00000001
  2305. /* Flags for Jet Property Management */
  2306. #define JET_bitPropDDL 0x00000001 /* also used for setting */
  2307. #define JET_bitPropInherited 0x00000002 /* not used for setting */
  2308. /* JPM Flags that are only used for setting properties */
  2309. #define JET_bitPropReplaceOnly 0x00000010
  2310. #define JET_bitPropInsertOnly 0x00000020
  2311. #define JET_bitPropDeleteOnly 0x00000040
  2312. /* InfoLevels for Jet Property Management */
  2313. #define JET_PropertyValue 0
  2314. #define JET_PropertyCount 1
  2315. #define JET_PropertySingleCollection 2
  2316. #define JET_PropertyAllCollections 3
  2317. /* Collate values for JetGetColumnInfo and JetGetIndexInfo */
  2318. #define JET_sortBinary 0x0000
  2319. #define JET_sortEFGPI 0x0100
  2320. #define JET_sortSNIFD 0x0101
  2321. #define JET_sortSpanish 0x0102
  2322. #define JET_sortDutch 0x0103
  2323. #define JET_sortSweFin 0x0104
  2324. #define JET_sortNorDan 0x0105
  2325. #define JET_sortIcelandic 0x0106
  2326. #define JET_sortCyrillic 0x0107
  2327. #define JET_sortCzech 0x0108
  2328. #define JET_sortHungarian 0x0109
  2329. #define JET_sortPolish 0x010A
  2330. #define JET_sortArabic 0x010B
  2331. #define JET_sortHebrew 0x010C
  2332. #define JET_sortMax 0x010C /* Max for nonDBCS sort orders */
  2333. #ifdef DBCS /* johnta: Add the new Japanese sorting order */
  2334. #define JET_sortJapanese 0x010D
  2335. #endif /* DBCS */
  2336. #define JET_sortUnknown 0xFFFF
  2337. /* Paradox ISAM specific collate values */
  2338. #define JET_sortPdxIntl 0x1000
  2339. #define JET_sortPdxSwedFin 0x1001
  2340. #define JET_sortPdxNorDan 0x1002
  2341. /* Info parameter for JetGetDatabaseInfo */
  2342. #define JET_DbInfoFilename 0
  2343. #define JET_DbInfoConnect 1
  2344. #define JET_DbInfoCountry 2
  2345. #define JET_DbInfoLangid 3
  2346. #define JET_DbInfoCp 4
  2347. #define JET_DbInfoCollate 5
  2348. #define JET_DbInfoOptions 6
  2349. #define JET_DbInfoTransactions 7
  2350. #define JET_DbInfoVersion 8
  2351. #define JET_DbInfoIsam 9
  2352. #define JET_DbInfoFilesize 10
  2353. #define JET_DbInfoSpaceOwned 11
  2354. #define JET_DbInfoSpaceAvailable 12
  2355. /* Database versions returned by JetGetDatabaseInfo */
  2356. #define JET_DbVersion10 0x00010000
  2357. #define JET_DbVersion11 0x00010001
  2358. #define JET_DbVersion20 0x00020000
  2359. /* Isam specific info returned by JetGetDatabaseInfo */
  2360. #define JET_IsamInvalid 0
  2361. #define JET_IsamBuiltinRed 1
  2362. #define JET_IsamBuiltinBlue 2
  2363. #define JET_IsamInstRed 21
  2364. #define JET_IsamInstBlue 22
  2365. #define JET_IsamInstFox 23
  2366. #define JET_IsamInstParadox 24
  2367. #define JET_IsamInstDbase 25
  2368. #define JET_IsamInstBtrieve 26
  2369. #define JET_IsamBuilinMost JET_BuiltinBlue
  2370. #define JET_IsamInstMin JET_IsamInstRed
  2371. #define JET_IsamInstMost JET_IsamInstBtrieve
  2372. /* Link specific info for link identification */
  2373. #define JET_bitLinkInvalid 0x00000000
  2374. #define JET_bitLinkRemote 0x00100000
  2375. #define JET_bitLinkBuiltinRed 0x00200000
  2376. #define JET_bitLinkBuiltinBlue 0x00300000
  2377. #define JET_bitLinkInstRed 0x00400000
  2378. #define JET_bitLinkInstBlue 0x00500000
  2379. #define JET_bitLinkInstFox 0x00600000
  2380. #define JET_bitLinkInstParadox 0x00700000
  2381. #define JET_bitLinkInstDbase 0x00800000
  2382. #define JET_bitLinkInstBtrieve 0x00900000
  2383. #define JET_bitFourByteBookmark 0x00000001
  2384. #define JET_bitContiguousBookmarks 0x00000002
  2385. /* Column data types */
  2386. #define JET_coltypNil 0
  2387. #define JET_coltypBit 1 /* True or False, Never NULL */
  2388. #define JET_coltypUnsignedByte 2 /* 1-byte integer, unsigned */
  2389. #define JET_coltypShort 3 /* 2-byte integer, signed */
  2390. #define JET_coltypLong 4 /* 4-byte integer, signed */
  2391. #define JET_coltypCurrency 5 /* 8 byte integer, signed */
  2392. #define JET_coltypIEEESingle 6 /* 4-byte IEEE single precision */
  2393. #define JET_coltypIEEEDouble 7 /* 8-byte IEEE double precision */
  2394. #define JET_coltypDateTime 8 /* Integral date, fractional time */
  2395. #define JET_coltypBinary 9 /* Binary data, < 255 bytes */
  2396. #define JET_coltypText 10 /* ANSI text, case insensitive, < 255 bytes */
  2397. #define JET_coltypLongBinary 11 /* Binary data, long value */
  2398. #define JET_coltypLongText 12 /* ANSI text, long value */
  2399. #define JET_coltypDatabase 13 /* Database name parameter */
  2400. #define JET_coltypTableid 14 /* Tableid parameter */
  2401. #define JET_coltypOLE 15 /* OLE blob */
  2402. #define JET_coltypGUID 15
  2403. #define JET_coltypMax 16 /* the number of column types */
  2404. /* used for validity tests and */
  2405. /* array declarations. */
  2406. /* Info levels for JetGetObjectInfo */
  2407. #define JET_ObjInfo 0U
  2408. #define JET_ObjInfoListNoStats 1U
  2409. #define JET_ObjInfoList 2U
  2410. #define JET_ObjInfoSysTabCursor 3U
  2411. #define JET_ObjInfoListACM 4U /* Blocked by JetGetObjectInfo */
  2412. #define JET_ObjInfoNoStats 5U
  2413. #define JET_ObjInfoSysTabReadOnly 6U
  2414. #define JET_ObjInfoRulesLoaded 7U
  2415. #define JET_ObjInfoMax 8U
  2416. /* Info levels for JetGetTableInfo */
  2417. #define JET_TblInfo 0U
  2418. #define JET_TblInfoName 1U
  2419. #define JET_TblInfoDbid 2U
  2420. #define JET_TblInfoMostMany 3U
  2421. #define JET_TblInfoRvt 4U
  2422. #define JET_TblInfoOLC 5U
  2423. #define JET_TblInfoResetOLC 6U
  2424. #define JET_TblInfoSpaceUsage 7U
  2425. #define JET_TblInfoDumpTable 8U
  2426. #define JET_TblInfoSpaceAlloc 9U
  2427. #define JET_TblInfoSpaceOwned 10U // OwnExt
  2428. #define JET_TblInfoSpaceAvailable 11U // AvailExt
  2429. /* Info levels for JetGetIndexInfo and JetGetTableIndexInfo */
  2430. #define JET_IdxInfo 0U
  2431. #define JET_IdxInfoList 1U
  2432. #define JET_IdxInfoSysTabCursor 2U
  2433. #define JET_IdxInfoOLC 3U
  2434. #define JET_IdxInfoResetOLC 4U
  2435. #define JET_IdxInfoSpaceAlloc 5U
  2436. #define JET_IdxInfoLangid 6U
  2437. #define JET_IdxInfoCount 7U
  2438. #define JET_IdxInfoVarSegMac 8U
  2439. /* Info levels for JetGetReferenceInfo and JetGetTableReferenceInfo */
  2440. #define JET_ReferenceInfo 0U
  2441. #define JET_ReferenceInfoReferencing 1U
  2442. #define JET_ReferenceInfoReferenced 2U
  2443. #define JET_ReferenceInfoAll 3U
  2444. #define JET_ReferenceInfoCursor 4U
  2445. /* Info levels for JetGetColumnInfo and JetGetTableColumnInfo */
  2446. #define JET_ColInfo 0U
  2447. #define JET_ColInfoList 1U
  2448. /* CONSIDER: Info level 2 is valid */
  2449. #define JET_ColInfoSysTabCursor 3U
  2450. #define JET_ColInfoBase 4U
  2451. #define JET_ColInfoListCompact 5U
  2452. /* Attribute types for query definitions */
  2453. #define JET_qoaBeginDef 0
  2454. #define JET_qoaOperation 1
  2455. #define JET_qoaParameter 2
  2456. #define JET_qoaOptions 3
  2457. #define JET_qoaDatabase 4
  2458. #define JET_qoaInputTable 5
  2459. #define JET_qoaOutput 6
  2460. #define JET_qoaJoin 7
  2461. #define JET_qoaRestriction 8
  2462. #define JET_qoaGroup 9
  2463. #define JET_qoaGroupRstr 10
  2464. #define JET_qoaOrdering 11
  2465. #define JET_qoaEndDef 255
  2466. #define JET_qoaValidLeast JET_qoaOperation
  2467. #define JET_qoaValidMost JET_qoaOrdering
  2468. /* Query object options */
  2469. #define JET_bitFqoOutputAllCols 0x0001
  2470. #define JET_bitFqoRemoveDups 0x0002
  2471. #define JET_bitFqoOwnerAccess 0x0004
  2472. #define JET_bitFqoDistinctRow 0x0008
  2473. #define JET_bitFqoTop 0x0010
  2474. #define JET_bitFqoPercent 0x0020
  2475. #define JET_bitFqoCorresponding 0x0040 /* JET_qopSetOperation */
  2476. /* Query object join type */
  2477. #define JET_fjoinInner 1
  2478. #define JET_fjoinLeftOuter 2
  2479. #define JET_fjoinRightOuter 3
  2480. /* Query object operations */
  2481. #define JET_qopSelect 1
  2482. #define JET_qopSelectInto 2
  2483. #define JET_qopInsertSelection 3
  2484. #define JET_qopUpdate 4
  2485. #define JET_qopDelete 5
  2486. #define JET_qopTransform 6
  2487. #define JET_qopDDL 7
  2488. #define JET_qopSqlPassThrough 8
  2489. #define JET_qopSetOperation 9
  2490. #define JET_qopSPTBulk 10
  2491. #define JET_bitqopSelect 0x0000
  2492. #define JET_bitqopTransform 0x0010
  2493. #define JET_bitqopDelete 0x0020
  2494. #define JET_bitqopUpdate 0x0030
  2495. #define JET_bitqopInsertSelection 0x0040
  2496. #define JET_bitqopSelectInto 0x0050
  2497. #define JET_bitqopDDL 0x0060
  2498. #define JET_bitqopSqlPassThrough 0x0070
  2499. #define JET_bitqopSetOperation 0x0080
  2500. #define JET_bitqopSPTBulk 0x0090
  2501. /* Engine Object Types */
  2502. #define JET_objtypNil 0
  2503. #define JET_objtypTable 1
  2504. #define JET_objtypDb 2
  2505. #define JET_objtypContainer 3
  2506. #define JET_objtypSQLLink 4
  2507. #define JET_objtypQuery 5
  2508. #define JET_objtypLink 6
  2509. #define JET_objtypTemplate 7
  2510. #define JET_objtypRelationship 8
  2511. /* All types less than JET_objtypClientMin are reserved by JET */
  2512. #define JET_objtypClientMin 0x8000
  2513. /* Security Constant Values */
  2514. #define JET_cchUserNameMax 20
  2515. #define JET_cchPasswordMax 14
  2516. /* Security Access Masks */
  2517. #define JET_acmNoAccess 0x00000000L
  2518. #define JET_acmFullAccess 0x000FFFFFL
  2519. #define JET_acmSpecificMask 0x0000FFFFL
  2520. #define JET_acmSpecific_1 0x00000001L
  2521. #define JET_acmSpecific_2 0x00000002L
  2522. #define JET_acmSpecific_3 0x00000004L
  2523. #define JET_acmSpecific_4 0x00000008L
  2524. #define JET_acmSpecific_5 0x00000010L
  2525. #define JET_acmSpecific_6 0x00000020L
  2526. #define JET_acmSpecific_7 0x00000040L
  2527. #define JET_acmSpecific_8 0x00000080L
  2528. #define JET_acmSpecific_9 0x00000100L
  2529. #define JET_acmSpecific_10 0x00000200L
  2530. #define JET_acmSpecific_11 0x00000400L
  2531. #define JET_acmSpecific_12 0x00000800L
  2532. #define JET_acmSpecific_13 0x00001000L
  2533. #define JET_acmSpecific_14 0x00002000L
  2534. #define JET_acmSpecific_15 0x00004000L
  2535. #define JET_acmSpecific_16 0x00008000L
  2536. #define JET_acmStandardMask 0x00FF0000L
  2537. #define JET_acmDelete 0x00010000L
  2538. #define JET_acmReadControl 0x00020000L
  2539. #define JET_acmWriteDac 0x00040000L
  2540. #define JET_acmWriteOwner 0x00080000L
  2541. #define JET_acmTblCreate (JET_acmSpecific_1)
  2542. #define JET_acmTblAccessRcols (JET_acmSpecific_2)
  2543. #define JET_acmTblReadDef (JET_acmSpecific_3)
  2544. #define JET_acmTblWriteDef (JET_acmSpecific_4)
  2545. #define JET_acmTblRetrieveData (JET_acmSpecific_5)
  2546. #define JET_acmTblInsertData (JET_acmSpecific_6)
  2547. #define JET_acmTblReplaceData (JET_acmSpecific_7)
  2548. #define JET_acmTblDeleteData (JET_acmSpecific_8)
  2549. #define JET_acmDbCreate (JET_acmSpecific_1)
  2550. #define JET_acmDbOpen (JET_acmSpecific_2)
  2551. /* Compact Options */
  2552. #define JET_bitCompactDontCopyLocale 0x00000004 /* Don't copy locale from source to dest */
  2553. #define JET_bitCompactVersion10 0x00000008 /* Destination is version 1.0 format */
  2554. #define JET_bitCompactVersion1x 0x00000010 /* Destination is version 1.x format */
  2555. #define JET_bitCompactStats 0x00000020 /* Dump off-line compaction stats (only when progress meter also specified) */
  2556. /* On-line Compact Options */
  2557. #define JET_bitCompactOn 0x00000001 /* enable on-line compaction */
  2558. /* Repair Notification Types */
  2559. #define JET_rntSelfContained 0
  2560. #define JET_rntDeletedIndex 1
  2561. #define JET_rntDeletedRec 2
  2562. #define JET_rntDeletedLv 3
  2563. #define JET_rntTruncated 4
  2564. /* Status Notification Processes */
  2565. #define JET_snpIndex 0
  2566. #define JET_snpQuery 1
  2567. #define JET_snpRepair 2
  2568. #define JET_snpImex 3
  2569. #define JET_snpCompact 4
  2570. #define JET_snpFastFind 5
  2571. #define JET_snpODBCNotReady 6
  2572. #define JET_snpQuerySort 7
  2573. #define JET_snpRestore 8
  2574. #define JET_snpBackup 9
  2575. #define JET_snpUpgrade 10
  2576. /* Status Notification Types */
  2577. #define JET_sntProgress 0 /* callback for progress */
  2578. #define JET_sntMessage 1
  2579. #define JET_sntBulkRecords 2 /* callback for # rec for bulk op */
  2580. #define JET_sntFail 3 /* callback for failure during progress */
  2581. #define JET_sntErrCount 4 /* callback for err count */
  2582. #define JET_sntBegin 5 /* callback for beginning of operation */
  2583. #define JET_sntComplete 6 /* callback for completion of operation */
  2584. #define JET_sntCantRollback 7 /* callback for no rollback */
  2585. #define JET_sntRestoreMap 8 /* callback for restore map */
  2586. /* Message codes for JET_snpCompact */
  2587. #define JET_sncCopyObject 0 /* Starting to copy object */
  2588. #define JET_sncCopyFailed 1 /* Copy of this object failed */
  2589. #define JET_sncYield 2 /* Client can yield/check for user interrupt */
  2590. #define JET_sncTransactionFull 3 /* Client can yield/check for user interrupt */
  2591. #define JET_sncAboutToWrap 4 /* Find find is about to wrap */
  2592. /* Message codes for JET_snpODBCNotReady */
  2593. #define JET_sncODBCNotReady 0 /* Waiting for results from ODBC */
  2594. /* Constants for the [ODBC] section of JET.INI */
  2595. #define JET_SQLTraceCanonical 0x0001 /* Output ODBC Generic SQL */
  2596. /* Constants for the [Debug] section of JET.INI */
  2597. /* APITrace */
  2598. #define JET_APITraceEnter 0x0001
  2599. #define JET_APITraceExit 0x0002
  2600. #define JET_APITraceExitError 0x0004
  2601. #define JET_APIBreakOnError 0x0008
  2602. #define JET_APITraceCount 0x0010
  2603. #define JET_APITraceNoIdle 0x0020
  2604. #define JET_APITraceParameters 0x0040
  2605. /* IdleTrace */
  2606. #define JET_IdleTraceCursor 0x0001
  2607. #define JET_IdleTraceBuffer 0x0002
  2608. #define JET_IdleTraceFlush 0x0004
  2609. /* AssertAction */
  2610. #define JET_AssertExit 0x0000 /* Exit the application */
  2611. #define JET_AssertBreak 0x0001 /* Break to debugger */
  2612. #define JET_AssertMsgBox 0x0002 /* Display message box */
  2613. #define JET_AssertStop 0x0004 /* Alert and stop */
  2614. /* IOTrace */
  2615. #define JET_IOTraceAlloc 0x0001 /* DB Page Allocation */
  2616. #define JET_IOTraceFree 0x0002 /* DB Page Free */
  2617. #define JET_IOTraceRead 0x0004 /* DB Page Read */
  2618. #define JET_IOTraceWrite 0x0008 /* DB Page Write */
  2619. #define JET_IOTraceError 0x0010 /* DB Page I/O Error */
  2620. /* MemTrace */
  2621. #define JET_MemTraceAlloc 0x0001 /* Memory allocation */
  2622. #define JET_MemTraceRealloc 0x0002 /* Memory reallocation */
  2623. #define JET_MemTraceFree 0x0004 /* Memory free */
  2624. /* RmtTrace */
  2625. #define JET_RmtTraceError 0x0001 /* Remote server error message */
  2626. #define JET_RmtTraceSql 0x0002 /* Remote SQL Prepares & Exec's */
  2627. #define JET_RmtTraceAPI 0x0004 /* Remote ODBC API calls */
  2628. #define JET_RmtTraceODBC 0x0008
  2629. #define JET_RmtSyncODBC 0x0010 /* Turn on ODBC Sync mode */
  2630. /**********************************************************************/
  2631. /*********************** ERROR CODES **************************/
  2632. /**********************************************************************/
  2633. /* SUCCESS */
  2634. #define JET_errSuccess 0 /* Successful Operation */
  2635. /* ERRORS */
  2636. #define JET_wrnNyi -1 /* Function Not Yet Implemented */
  2637. /* SYSTEM errors
  2638. /**/
  2639. #define JET_errRfsFailure -100 /* JET_errRfsFailure */
  2640. #define JET_errRfsNotArmed -101 /* JET_errRfsFailure */
  2641. #define JET_errFileClose -102 /* Could not close DOS file */
  2642. #define JET_errOutOfThreads -103 /* Could not start thread */
  2643. #define JET_errTooManyIO -105 /* System busy due to too many IOs */
  2644. #define JET_errDatabase200Format -106 /* 200 format database */
  2645. #define JET_errDatabase400Format -107 /* 400 format database */
  2646. /* BUFFER MANAGER errors
  2647. /**/
  2648. #define wrnBFNotSynchronous 200 /* Buffer page evicted */
  2649. #define wrnBFPageNotFound 201 /* Page not found */
  2650. #define errBFInUse -202 /* Cannot abandon buffer */
  2651. #define wrnBFNewIO 203 /* Buffer access caused a new IO (cache miss) */
  2652. #define wrnBFCacheMiss 204 /* Buffer access was a cache miss but didn't cause a new IO */
  2653. #define wrnBFNoBufAvailable 205 /* Need to allocate new buffer for read (used in Async IO ) */
  2654. /* DIRECTORY MANAGER errors
  2655. /**/
  2656. #define errPMOutOfPageSpace -300 /* Out of page space */
  2657. #define errPMItagTooBig -301 /* Itag too big */
  2658. #define errPMRecDeleted -302 /* Record deleted */
  2659. #define errPMTagsUsedUp -303 /* Tags used up */
  2660. #define wrnBMConflict 304 /* conflict in BM Clean up */
  2661. #define errDIRNoShortCircuit -305 /* No Short Circuit Avail */
  2662. #define errDIRCannotSplit -306 /* Cannot horizontally split FDP */
  2663. #define errDIRTop -307 /* Cannot go up */
  2664. #define errDIRFDP 308 /* On an FDP Node */
  2665. #define errDIRNotSynchronous -309 /* May have left critical section */
  2666. #define wrnDIREmptyPage 310 /* Moved through empty page */
  2667. #define errSPConflict -311 /* Device extent being extended */
  2668. #define wrnNDFoundLess 312 /* Found Less */
  2669. #define wrnNDFoundGreater 313 /* Found Greater */
  2670. #define errNDOutSonRange -314 /* Son out of range */
  2671. #define errNDOutItemRange -315 /* Item out of range */
  2672. #define errNDGreaterThanAllItems -316 /* Greater than all items */
  2673. #define errNDLastItemNode -317 /* Last node of item list */
  2674. #define errNDFirstItemNode -318 /* First node of item list */
  2675. #define wrnNDDuplicateItem 319 /* Duplicated Item */
  2676. #define errNDNoItem -320 /* Item not there */
  2677. #define JET_wrnRemainingVersions 321 /* Some versions couldn't be cleaned */
  2678. #define JET_errPreviousVersion -322 /* Version already existed */
  2679. #define JET_errPageBoundary -323 /* Reached Page Boundary */
  2680. #define JET_errKeyBoundary -324 /* Reached Key Boundary */
  2681. #define errDIRInPageFather -325 /* sridFather in page to free */
  2682. #define errBMMaxKeyInPage -326 /* used by OLC to avoid cleanup of parent pages */
  2683. #define JET_errBadPageLink -327 /* next/previous page link page does not point back to source */
  2684. #define JET_errBadBookmark -328 /* bookmark has no corresponding address in database */
  2685. #define wrnBMCleanNullOp 329 /* BMClean returns this on encountering a page */
  2686. /* deleted MaxKeyInPage [but there was no conflict] */
  2687. #define JET_errNTSystemCallFailed -334 // can not get OS version
  2688. /* RECORD MANAGER errors
  2689. /**/
  2690. #define wrnFLDKeyTooBig 400 /* Key too big (truncated it) */
  2691. #define errFLDTooManySegments -401 /* Too many key segments */
  2692. #define wrnFLDNullKey 402 /* Key is entirely NULL */
  2693. #define wrnFLDOutOfKeys 403 /* No more keys to extract */
  2694. #define wrnFLDNullSeg 404 /* Null segment in key */
  2695. #define wrnRECLongField 405 /* Separated long value */
  2696. #define JET_wrnSeparateLongValue 406 /* Separated long value */
  2697. #define JET_wrnRecordFoundGreater JET_wrnSeekNotEqual
  2698. #define JET_wrnRecordFoundLess JET_wrnSeekNotEqual
  2699. #define JET_errColumnIllegalNull JET_errNullInvalid
  2700. #define wrnFLDNullFirstSeg 407 /* Null first segment in key */
  2701. #define JET_errKeyTooBig -408 /* Key with column truncation still truncated */
  2702. /* LOGGING/RECOVERY errors
  2703. /**/
  2704. #define JET_errInvalidLoggedOperation -500 /* Logged operation cannot be redone */
  2705. #define JET_errLogFileCorrupt -501 /* Log file is corrupt */
  2706. #define errLGNoMoreRecords -502 /* Last log record read */
  2707. #define JET_errNoBackupDirectory -503 /* No backup directory given */
  2708. #define JET_errBackupDirectoryNotEmpty -504 /* The backup directory is not emtpy */
  2709. #define JET_errBackupInProgress -505 /* Backup is active already */
  2710. #define JET_errMissingPreviousLogFile -509 /* Missing the log file for check point */
  2711. #define JET_errLogWriteFail -510 /* Fail when writing to log file */
  2712. #define JET_errBadLogVersion -514 /* Version of log file is not compatible with Jet version */
  2713. #define JET_errInvalidLogSequence -515 /* Timestamp in next log does not match expected */
  2714. #define JET_errLoggingDisabled -516 /* Log is not active */
  2715. #define JET_errLogBufferTooSmall -517 /* Log buffer is too small for recovery */
  2716. #define errLGNotSynchronous -518 /* retry to LGLogRec */
  2717. #define JET_errLogSequenceEnd -519 /* Exceed maximum log file number */
  2718. #define JET_errNoBackup -520 /* No backup in progress */
  2719. #define JET_errInvalidBackupSequence -521 /* Backup call out of sequence */
  2720. #define JET_errBackupNotAllowedYet -523 /* Can not do backup now */
  2721. #define JET_errDeleteBackupFileFail -524 /* Could not delete backup file */
  2722. #define JET_errMakeBackupDirectoryFail -525 /* Could not make backup temp directory */
  2723. #define JET_errInvalidBackup -526 /* Cannot incremental backup when circular logging enabled */
  2724. #define JET_errRecoveredWithErrors -527 /* For repair, restored with errors */
  2725. #define JET_errMissingLogFile -528 /* current log file missing */
  2726. #define JET_errLogDiskFull -529 /* log disk full */
  2727. #define JET_errBadLogSignature -530 /* bad signature for a log file */
  2728. #define JET_errBadDbSignature -531 /* bad signature for a db file */
  2729. #define JET_errBadCheckpointSignature -532 /* bad signature for a checkpoint file */
  2730. #define JET_errCheckpointCorrupt -533 /* checkpoint file not found or corrupt */
  2731. #define JET_errMissingPatchPage -534 /* patch file page not found during recovery */
  2732. #define JET_errDatabaseInconsistent -550 /* database is in inconsistent state */
  2733. #define JET_errConsistentTimeMismatch -551 /* database last consistent time unmatched */
  2734. #define JET_errDatabasePatchFileMismatch -552 /* patch file is not generated from this backup */
  2735. #define JET_errEndingRestoreLogTooLow -553 /* the starting log number too low for the restore */
  2736. #define JET_errStartingRestoreLogTooHigh -554 /* the starting log number too high for the restore */
  2737. #define JET_errGivenLogFileHasBadSignature -555 /* Restore log file has bad signature */
  2738. #define JET_errGivenLogFileIsNotContiguous -556 /* Restore log file is not contiguous */
  2739. #define JET_errMissingRestoreLogFiles -557 /* Some restore log files are missing */
  2740. #define JET_wrnExistingLogFileHasBadSignature 558 /* Existing log file has bad signature */
  2741. #define JET_wrnExistingLogFileIsNotContiguous 559 /* Existing log file is not contiguous */
  2742. #define JET_errMissingFullBackup -560 /* The database miss a previous full backup befor incremental backup */
  2743. #define JET_errBadBackupDatabaseSize -561 /* The backup database size is not in 4k */
  2744. #define JET_errDatabaseAlreadyUpgraded -562 /* Attempted to upgrade a database that is already current */
  2745. #define JET_errTermInProgress -1000 /* Termination in progress */
  2746. #define JET_errFeatureNotAvailable -1001 /* API not supported */
  2747. #define JET_errInvalidName -1002 /* Invalid name */
  2748. #define JET_errInvalidParameter -1003 /* Invalid API parameter */
  2749. #define JET_wrnColumnNull 1004 /* Column is NULL-valued */
  2750. #define JET_wrnBufferTruncated 1006 /* Buffer too small for data */
  2751. #define JET_wrnDatabaseAttached 1007 /* Database is already attached */
  2752. #define JET_errDatabaseFileReadOnly -1008 /* Attach a readonly database file for read/write operations */
  2753. #define JET_wrnSortOverflow 1009 /* Sort does not fit in memory */
  2754. #define JET_errInvalidDatabaseId -1010 /* Invalid database id */
  2755. #define JET_errOutOfMemory -1011 /* Out of Memory */
  2756. #define JET_errOutOfDatabaseSpace -1012 /* Maximum database size reached */
  2757. #define JET_errOutOfCursors -1013 /* Out of table cursors */
  2758. #define JET_errOutOfBuffers -1014 /* Out of database page buffers */
  2759. #define JET_errTooManyIndexes -1015 /* Too many indexes */
  2760. #define JET_errTooManyKeys -1016 /* Too many columns in an index */
  2761. #define JET_errRecordDeleted -1017 /* Record has been deleted */
  2762. #define JET_errReadVerifyFailure -1018 /* Read verification error */
  2763. #define JET_errOutOfFileHandles -1020 /* Out of file handles */
  2764. #define JET_errDiskIO -1022 /* Disk IO error */
  2765. #define JET_errInvalidPath -1023 /* Invalid file path */
  2766. #define JET_errRecordTooBig -1026 /* Record larger than maximum size */
  2767. #define JET_errTooManyOpenDatabases -1027 /* Too many open databases */
  2768. #define JET_errInvalidDatabase -1028 /* Not a database file */
  2769. #define JET_errNotInitialized -1029 /* JetInit not yet called */
  2770. #define JET_errAlreadyInitialized -1030 /* JetInit already called */
  2771. #define JET_errFileAccessDenied -1032 /* Cannot access file */
  2772. #define JET_errQueryNotSupported -1034 /* Query support unavailable */
  2773. #define JET_errSQLLinkNotSupported -1035 /* SQL Link support unavailable */
  2774. #define JET_errBufferTooSmall -1038 /* Buffer is too small */
  2775. #define JET_wrnSeekNotEqual 1039 /* SeekLE or SeekGE didn't find exact match */
  2776. #define JET_errTooManyColumns -1040 /* Too many columns defined */
  2777. #define JET_errContainerNotEmpty -1043 /* Container is not empty */
  2778. #define JET_errInvalidFilename -1044 /* Filename is invalid */
  2779. #define JET_errInvalidBookmark -1045 /* Invalid bookmark */
  2780. #define JET_errColumnInUse -1046 /* Column used in an index */
  2781. #define JET_errInvalidBufferSize -1047 /* Data buffer doesn't match column size */
  2782. #define JET_errColumnNotUpdatable -1048 /* Cannot set column value */
  2783. #define JET_errIndexInUse -1051 /* Index is in use */
  2784. #define JET_errLinkNotSupported -1052 /* Link support unavailable */
  2785. #define JET_errNullKeyDisallowed -1053 /* Null keys are disallowed on index */
  2786. #define JET_errNotInTransaction -1054 /* Operation must be within a transaction */
  2787. #define JET_wrnNoErrorInfo 1055 /* No extended error information */
  2788. #define JET_wrnNoIdleActivity 1058 /* No idle activity occured */
  2789. #define JET_errTooManyActiveUsers -1059 /* Too many active database users */
  2790. #define JET_errInvalidAppend -1060 /* Cannot append long value */
  2791. #define JET_errInvalidCountry -1061 /* Invalid or unknown country code */
  2792. #define JET_errInvalidLanguageId -1062 /* Invalid or unknown language id */
  2793. #define JET_errInvalidCodePage -1063 /* Invalid or unknown code page */
  2794. #define JET_wrnNoWriteLock 1067 /* No write lock at transaction level 0 */
  2795. #define JET_wrnColumnSetNull 1068 /* Column set to NULL-value */
  2796. #define JET_errVersionStoreOutOfMemory -1069 /* lMaxVerPages exceeded (XJET only) */
  2797. #define JET_errCurrencyStackOutOfMemory -1070 /* lCSRPerfFUCB * lMaxCursors exceeded (XJET only) */
  2798. #define JET_errOutOfSessions -1101 /* Out of sessions */
  2799. #define JET_errWriteConflict -1102 /* Write lock failed due to outstanding write lock */
  2800. #define JET_errTransTooDeep -1103 /* Xactions nested too deeply */
  2801. #define JET_errInvalidSesid -1104 /* Invalid session handle */
  2802. #define JET_errSessionWriteConflict -1107 /* Another session has private version of page */
  2803. #define JET_errInTransaction -1108 /* Operation not allowed within a transaction */
  2804. #define JET_errRollbackRequired -1109 /* Must rollback current transaction -- cannot commit or begin a new one */
  2805. #define JET_errDatabaseDuplicate -1201 /* Database already exists */
  2806. #define JET_errDatabaseInUse -1202 /* Database in use */
  2807. #define JET_errDatabaseNotFound -1203 /* No such database */
  2808. #define JET_errDatabaseInvalidName -1204 /* Invalid database name */
  2809. #define JET_errDatabaseInvalidPages -1205 /* Invalid number of pages */
  2810. #define JET_errDatabaseCorrupted -1206 /* non-db file or corrupted db */
  2811. #define JET_errDatabaseLocked -1207 /* Database exclusively locked */
  2812. #define JET_errCannotDisableVersioning -1208 /* Cannot disable versioning for this database */
  2813. #define JET_wrnTableEmpty 1301 /* Open an empty table */
  2814. #define JET_errTableLocked -1302 /* Table is exclusively locked */
  2815. #define JET_errTableDuplicate -1303 /* Table already exists */
  2816. #define JET_errTableInUse -1304 /* Table is in use, cannot lock */
  2817. #define JET_errObjectNotFound -1305 /* No such table or object */
  2818. #define JET_errDensityInvalid -1307 /* Bad file/index density */
  2819. #define JET_errTableNotEmpty -1308 /* Cannot define clustered index */
  2820. #define JET_errInvalidTableId -1310 /* Invalid table id */
  2821. #define JET_errTooManyOpenTables -1311 /* Cannot open any more tables */
  2822. #define JET_errIllegalOperation -1312 /* Oper. not supported on table */
  2823. #define JET_errObjectDuplicate -1314 /* Table or object name in use */
  2824. #define JET_errInvalidObject -1316 /* object is invalid for operation */
  2825. #define JET_errIndexCantBuild -1401 /* Cannot build clustered index */
  2826. #define JET_errIndexHasPrimary -1402 /* Primary index already defined */
  2827. #define JET_errIndexDuplicate -1403 /* Index is already defined */
  2828. #define JET_errIndexNotFound -1404 /* No such index */
  2829. #define JET_errIndexMustStay -1405 /* Cannot delete clustered index */
  2830. #define JET_errIndexInvalidDef -1406 /* Illegal index definition */
  2831. #define JET_errIndexHasClustered -1408 /* Clustered index already defined */
  2832. #define JET_errInvalidCreateIndex -1409 /* Invali create index description */
  2833. #define JET_errTooManyOpenIndexes -1410 /* Out of index description blocks */
  2834. #define JET_errPrimaryIndexCorrupted -1413 /* Primary index is corrupt -- defrag required */
  2835. #define JET_errSecondaryIndexCorrupted -1414 /* Secondary index is corrupt -- defrag required */
  2836. #define JET_errColumnLong -1501 /* Column value is long */
  2837. #define JET_errColumnNoChunk -1502 /* no such chunk in long value */
  2838. #define JET_errColumnDoesNotFit -1503 /* Field will not fit in record */
  2839. #define JET_errNullInvalid -1504 /* Null not valid */
  2840. #define JET_errColumnIndexed -1505 /* Column indexed, cannot delete */
  2841. #define JET_errColumnTooBig -1506 /* Field length is > maximum */
  2842. #define JET_errColumnNotFound -1507 /* No such column */
  2843. #define JET_errColumnDuplicate -1508 /* Field is already defined */
  2844. #define JET_errColumn2ndSysMaint -1510 /* Second autoinc or version column */
  2845. #define JET_errInvalidColumnType -1511 /* Invalid column data type */
  2846. #define JET_wrnColumnMaxTruncated 1512 /* Max length too big, truncated */
  2847. #define JET_errColumnCannotIndex -1513 /* Cannot index Bit,LongText,LongBinary */
  2848. #define JET_errTaggedNotNULL -1514 /* No non-NULL tagged columns */
  2849. #define JET_errNoCurrentIndex -1515 /* Invalid w/o a current index */
  2850. #define JET_errKeyIsMade -1516 /* The key is completely made */
  2851. #define JET_errBadColumnId -1517 /* Column Id Incorrect */
  2852. #define JET_errBadItagSequence -1518 /* Bad itagSequence for tagged column */
  2853. #define JET_errColumnInRelationship -1519 /* Cannot delete, column participates in relationship */
  2854. #define JET_wrnCopyLongValue 1520 /* Single instance column bursted */
  2855. #define JET_errCannotBeTagged -1521 /* AutoIncrement and Version cannot be tagged */
  2856. #define JET_errRecordNotFound -1601 /* The key was not found */
  2857. #define JET_errRecordNoCopy -1602 /* No working buffer */
  2858. #define JET_errNoCurrentRecord -1603 /* Currency not on a record */
  2859. #define JET_errRecordClusteredChanged -1604 /* Clustered key may not change */
  2860. #define JET_errKeyDuplicate -1605 /* Illegal duplicate key */
  2861. #define JET_errAlreadyPrepared -1607 /* Already copy/clear current */
  2862. #define JET_errKeyNotMade -1608 /* No call to JetMakeKey */
  2863. #define JET_errUpdateNotPrepared -1609 /* No call to JetPrepareUpdate */
  2864. #define JET_wrnDataHasChanged 1610 /* Data has changed */
  2865. #define JET_errDataHasChanged -1611 /* Data has changed, operation aborted */
  2866. #define JET_wrnKeyChanged 1618 /* Moved to new key */
  2867. #define JET_errTooManySorts -1701 /* Too many sort processes */
  2868. #define JET_errInvalidOnSort -1702 /* Invalid operation on Sort */
  2869. #define JET_errTempFileOpenError -1803 /* Temp file could not be opened */
  2870. #define JET_errTooManyAttachedDatabases -1805 /* Too many open databases */
  2871. #define JET_errDiskFull -1808 /* No space left on disk */
  2872. #define JET_errPermissionDenied -1809 /* Permission denied */
  2873. #define JET_errFileNotFound -1811 /* File not found */
  2874. #define JET_wrnFileOpenReadOnly 1813 /* Database file is read only */
  2875. #define JET_errAfterInitialization -1850 /* Cannot Restore after init. */
  2876. #define JET_errLogCorrupted -1852 /* Logs could not be interpreted */
  2877. #define JET_errInvalidOperation -1906 /* invalid operation */
  2878. #define JET_errAccessDenied -1907 /* access denied */
  2879. #define JET_wrnIdleFull 1908 /* ilde registry full */
  2880. #define JET_errTooManySplits -1909 /* Infinite split. Call PSS */
  2881. #define JET_errSessionSharingViolation -1910 /* Multiple threads are using the same session */
  2882. /**********************************************************************/
  2883. /*********************** PROTOTYPES **************************/
  2884. /**********************************************************************/
  2885. #if !defined(_JET_NOPROTOTYPES)
  2886. JET_ERR JET_API JetInit(JET_INSTANCE *pinstance);
  2887. JET_ERR JET_API JetTerm(JET_INSTANCE instance);
  2888. JET_ERR JET_API JetTerm2( JET_INSTANCE instance, JET_GRBIT grbit );
  2889. JET_ERR JET_API JetSetSystemParameter(JET_INSTANCE *pinstance, JET_SESID sesid, unsigned long paramid,
  2890. unsigned long lParam, const char *sz);
  2891. JET_ERR JET_API JetGetSystemParameter(JET_INSTANCE instance, JET_SESID sesid, unsigned long paramid,
  2892. unsigned long *plParam, char *sz, unsigned long cbMax);
  2893. #define ctAccessPage 1
  2894. #define ctLatchConflict 2
  2895. #define ctSplitRetry 3
  2896. #define ctNeighborPageScanned 4
  2897. #define ctSplits 5
  2898. JET_ERR JET_API JetResetCounter( JET_SESID sesid, long CounterType );
  2899. JET_ERR JET_API JetGetCounter( JET_SESID sesid, long CounterType, long *plValue );
  2900. JET_ERR JET_API JetBeginSession(JET_INSTANCE instance, JET_SESID *psesid,
  2901. const char *szUserName, const char *szPassword);
  2902. JET_ERR JET_API JetDupSession(JET_SESID sesid, JET_SESID *psesid);
  2903. JET_ERR JET_API JetEndSession(JET_SESID sesid, JET_GRBIT grbit);
  2904. JET_ERR JET_API JetGetVersion(JET_SESID sesid, unsigned long *pwVersion);
  2905. JET_ERR JET_API JetIdle(JET_SESID sesid, JET_GRBIT grbit);
  2906. JET_ERR JET_API JetCreateDatabase(JET_SESID sesid,
  2907. const char *szFilename, const char *szConnect,
  2908. JET_DBID *pdbid, JET_GRBIT grbit);
  2909. JET_ERR JET_API JetAttachDatabase(JET_SESID sesid, const char *szFilename, JET_GRBIT grbit );
  2910. JET_ERR JET_API JetDetachDatabase(JET_SESID sesid, const char *szFilename);
  2911. JET_ERR JET_API JetCreateTable(JET_SESID sesid, JET_DBID dbid,
  2912. const char *szTableName, unsigned long lPages, unsigned long lDensity,
  2913. JET_TABLEID *ptableid);
  2914. JET_ERR JET_API JetCreateTableColumnIndex( JET_SESID sesid, JET_DBID dbid,
  2915. JET_TABLECREATE *ptablecreate );
  2916. JET_ERR JET_API JetDeleteTable(JET_SESID sesid, JET_DBID dbid,
  2917. const char *szTableName);
  2918. JET_ERR JET_API JetGetTableColumnInfo(JET_SESID sesid, JET_TABLEID tableid,
  2919. const char *szColumnName, void *pvResult, unsigned long cbMax,
  2920. unsigned long InfoLevel);
  2921. JET_ERR JET_API JetGetColumnInfo(JET_SESID sesid, JET_DBID dbid,
  2922. const char *szTableName, const char *szColumnName,
  2923. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  2924. JET_ERR JET_API JetAddColumn(JET_SESID sesid, JET_TABLEID tableid,
  2925. const char *szColumn, const JET_COLUMNDEF *pcolumndef,
  2926. const void *pvDefault, unsigned long cbDefault,
  2927. JET_COLUMNID *pcolumnid);
  2928. JET_ERR JET_API JetDeleteColumn(JET_SESID sesid, JET_TABLEID tableid,
  2929. const char *szColumn);
  2930. JET_ERR JET_API JetGetTableIndexInfo(JET_SESID sesid, JET_TABLEID tableid,
  2931. const char *szIndexName, void *pvResult, unsigned long cbResult,
  2932. unsigned long InfoLevel);
  2933. JET_ERR JET_API JetGetTableInfo(JET_SESID sesid, JET_TABLEID tableid,
  2934. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  2935. JET_ERR JET_API JetGetIndexInfo(JET_SESID sesid, JET_DBID dbid,
  2936. const char *szTableName, const char *szIndexName,
  2937. void *pvResult, unsigned long cbResult, unsigned long InfoLevel);
  2938. JET_ERR JET_API JetCreateIndex(JET_SESID sesid, JET_TABLEID tableid,
  2939. const char *szIndexName, JET_GRBIT grbit,
  2940. const char *szKey, unsigned long cbKey, unsigned long lDensity);
  2941. JET_ERR JET_API JetDeleteIndex(JET_SESID sesid, JET_TABLEID tableid,
  2942. const char *szIndexName);
  2943. JET_ERR JET_API JetGetObjectInfo(JET_SESID sesid, JET_DBID dbid,
  2944. JET_OBJTYP objtyp, const char *szContainerName,
  2945. const char *szObjectName, void *pvResult, unsigned long cbMax,
  2946. unsigned long InfoLevel);
  2947. JET_ERR JET_API JetBeginTransaction(JET_SESID sesid);
  2948. JET_ERR JET_API JetCommitTransaction(JET_SESID sesid, JET_GRBIT grbit);
  2949. JET_ERR JET_API JetRollback(JET_SESID sesid, JET_GRBIT grbit);
  2950. JET_ERR JET_API JetGetDatabaseInfo(JET_SESID sesid, JET_DBID dbid,
  2951. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  2952. JET_ERR JET_API JetCloseDatabase(JET_SESID sesid, JET_DBID dbid,
  2953. JET_GRBIT grbit);
  2954. JET_ERR JET_API JetCloseTable(JET_SESID sesid, JET_TABLEID tableid);
  2955. JET_ERR JET_API JetOpenDatabase(JET_SESID sesid, const char *szFilename,
  2956. const char *szConnect, JET_DBID *pdbid, JET_GRBIT grbit);
  2957. JET_ERR JET_API JetOpenTable(JET_SESID sesid, JET_DBID dbid,
  2958. const char *szTableName, const void *pvParameters,
  2959. unsigned long cbParameters, JET_GRBIT grbit, JET_TABLEID *ptableid);
  2960. JET_ERR JET_API JetDelete(JET_SESID sesid, JET_TABLEID tableid);
  2961. JET_ERR JET_API JetUpdate(JET_SESID sesid, JET_TABLEID tableid,
  2962. void *pvBookmark, unsigned long cbBookmark,
  2963. unsigned long *pcbActual);
  2964. JET_ERR JET_API JetRetrieveColumn(JET_SESID sesid, JET_TABLEID tableid,
  2965. JET_COLUMNID columnid, void *pvData, unsigned long cbData,
  2966. unsigned long *pcbActual, JET_GRBIT grbit, JET_RETINFO *pretinfo);
  2967. JET_ERR JET_API JetRetrieveColumns( JET_SESID sesid, JET_TABLEID tableid,
  2968. JET_RETRIEVECOLUMN *pretrievecolumn, unsigned long cretrievecolumn );
  2969. JET_ERR JET_API JetSetColumn(JET_SESID sesid, JET_TABLEID tableid,
  2970. JET_COLUMNID columnid, const void *pvData, unsigned long cbData,
  2971. JET_GRBIT grbit, JET_SETINFO *psetinfo);
  2972. JET_ERR JET_API JetSetColumns(JET_SESID sesid, JET_TABLEID tableid,
  2973. JET_SETCOLUMN *psetcolumn, unsigned long csetcolumn );
  2974. JET_ERR JET_API JetPrepareUpdate(JET_SESID sesid, JET_TABLEID tableid,
  2975. unsigned long prep);
  2976. JET_ERR JET_API JetGetRecordPosition(JET_SESID sesid, JET_TABLEID tableid,
  2977. JET_RECPOS *precpos, unsigned long cbRecpos);
  2978. JET_ERR JET_API JetGotoPosition(JET_SESID sesid, JET_TABLEID tableid,
  2979. JET_RECPOS *precpos );
  2980. JET_ERR JET_API JetGetCursorInfo(JET_SESID sesid, JET_TABLEID tableid,
  2981. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  2982. JET_ERR JET_API JetDupCursor(JET_SESID sesid, JET_TABLEID tableid,
  2983. JET_TABLEID *ptableid, JET_GRBIT grbit);
  2984. JET_ERR JET_API JetGetCurrentIndex(JET_SESID sesid, JET_TABLEID tableid,
  2985. char *szIndexName, unsigned long cchIndexName);
  2986. JET_ERR JET_API JetSetCurrentIndex(JET_SESID sesid, JET_TABLEID tableid,
  2987. const char *szIndexName);
  2988. JET_ERR JET_API JetSetCurrentIndex2(JET_SESID sesid, JET_TABLEID tableid,
  2989. const char *szIndexName, JET_GRBIT grbit );
  2990. JET_ERR JET_API JetMove(JET_SESID sesid, JET_TABLEID tableid,
  2991. long cRow, JET_GRBIT grbit);
  2992. JET_ERR JET_API JetMakeKey(JET_SESID sesid, JET_TABLEID tableid,
  2993. const void *pvData, unsigned long cbData, JET_GRBIT grbit);
  2994. JET_ERR JET_API JetSeek(JET_SESID sesid, JET_TABLEID tableid,
  2995. JET_GRBIT grbit);
  2996. JET_ERR JET_API JetGetBookmark(JET_SESID sesid, JET_TABLEID tableid,
  2997. void *pvBookmark, unsigned long cbMax,
  2998. unsigned long *pcbActual);
  2999. JET_ERR JET_API JetCompact(JET_SESID sesid, const char *szDatabaseSrc,
  3000. const char *szDatabaseDest, JET_PFNSTATUS pfnStatus, JET_CONVERT *pconvert,
  3001. JET_GRBIT grbit);
  3002. JET_ERR JET_API JetDBUtilities( JET_DBUTIL *pdbutil );
  3003. JET_ERR JET_API JetGotoBookmark(JET_SESID sesid, JET_TABLEID tableid,
  3004. void *pvBookmark, unsigned long cbBookmark);
  3005. JET_ERR JET_API JetComputeStats(JET_SESID sesid, JET_TABLEID tableid);
  3006. typedef unsigned long JET_VSESID; /* Received from dispatcher */
  3007. struct tagVDBFNDEF;
  3008. typedef unsigned long JET_VDBID; /* Received from dispatcher */
  3009. struct tagVTFNDEF;
  3010. typedef unsigned long JET_VTID; /* Received from dispatcher */
  3011. JET_ERR JET_API JetOpenTempTable(JET_SESID sesid,
  3012. const JET_COLUMNDEF *prgcolumndef, unsigned long ccolumn,
  3013. JET_GRBIT grbit, JET_TABLEID *ptableid,
  3014. JET_COLUMNID *prgcolumnid);
  3015. JET_ERR JET_API JetOpenTempTable2( JET_SESID sesid,
  3016. const JET_COLUMNDEF *prgcolumndef,
  3017. unsigned long ccolumn,
  3018. unsigned long langid,
  3019. JET_GRBIT grbit,
  3020. JET_TABLEID *ptableid,
  3021. JET_COLUMNID *prgcolumnid );
  3022. JET_ERR JET_API JetBackup( const char *szBackupPath, JET_GRBIT grbit, JET_PFNSTATUS pfnStatus );
  3023. JET_ERR JET_API JetRestore(const char *sz, JET_PFNSTATUS pfn );
  3024. JET_ERR JET_API JetRestore2(const char *sz, const char *szDest, JET_PFNSTATUS pfn );
  3025. JET_ERR JET_API JetSetIndexRange(JET_SESID sesid,
  3026. JET_TABLEID tableidSrc, JET_GRBIT grbit);
  3027. JET_ERR JET_API JetIndexRecordCount(JET_SESID sesid,
  3028. JET_TABLEID tableid, unsigned long *pcrec, unsigned long crecMax );
  3029. JET_ERR JET_API JetRetrieveKey(JET_SESID sesid,
  3030. JET_TABLEID tableid, void *pvData, unsigned long cbMax,
  3031. unsigned long *pcbActual, JET_GRBIT grbit );
  3032. JET_ERR JET_API JetBeginExternalBackup( JET_GRBIT grbit );
  3033. JET_ERR JET_API JetGetAttachInfo( void *pv,
  3034. unsigned long cbMax,
  3035. unsigned long *pcbActual );
  3036. JET_ERR JET_API JetOpenFile( const char *szFileName,
  3037. JET_HANDLE *phfFile,
  3038. unsigned long *pulFileSizeLow,
  3039. unsigned long *pulFileSizeHigh );
  3040. JET_ERR JET_API JetReadFile( JET_HANDLE hfFile,
  3041. void *pv,
  3042. unsigned long cb,
  3043. unsigned long *pcb );
  3044. JET_ERR JET_API JetCloseFile( JET_HANDLE hfFile );
  3045. JET_ERR JET_API JetGetLogInfo( void *pv,
  3046. unsigned long cbMax,
  3047. unsigned long *pcbActual );
  3048. JET_ERR JET_API JetTruncateLog( void );
  3049. JET_ERR JET_API JetEndExternalBackup( void );
  3050. JET_ERR JET_API JetExternalRestore( char *szCheckpointFilePath, char *szLogPath, JET_RSTMAP *rgstmap, long crstfilemap, char *szBackupLogPath, long genLow, long genHigh, JET_PFNSTATUS pfn );
  3051. #endif /* _JET_NOPROTOTYPES */
  3052. #include <poppack.h>
  3053. #ifdef __cplusplus
  3054. }
  3055. #endif
  3056. #endif /* _JET_INCLUDED */
  3057. #endif /* _USE_OLD_JET_H_ */