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

1811 lines
68 KiB

  1. #if !defined(_JET_INCLUDED)
  2. #define _JET_INCLUDED
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #if defined(_M_ALPHA)
  7. #pragma pack(8)
  8. #else
  9. #pragma pack(4)
  10. #endif
  11. #define JET_API __stdcall
  12. #define JET_NODSAPI __stdcall
  13. typedef long JET_ERR;
  14. typedef unsigned long JET_INSTANCE; /* Instance Identifier */
  15. typedef ULONG_PTR JET_SESID; /* Session Identifier */
  16. typedef ULONG_PTR JET_TABLEID; /* Table Identifier */
  17. typedef unsigned long JET_COLUMNID; /* Column Identifier */
  18. typedef ULONG_PTR JET_DBID; /* Database Identifier */
  19. typedef unsigned long JET_OBJTYP; /* Object Type */
  20. typedef unsigned long JET_COLTYP; /* Column Type */
  21. typedef unsigned long JET_GRBIT; /* Group of Bits */
  22. typedef unsigned long JET_ACM; /* Access Mask */
  23. typedef unsigned long JET_RNT; /* Repair Notification Type */
  24. typedef unsigned long JET_SNP; /* Status Notification Process */
  25. typedef unsigned long JET_SNT; /* Status Notification Type */
  26. typedef unsigned long JET_SNC; /* Status Notification Code */
  27. typedef double JET_DATESERIAL; /* JET_coltypDateTime format */
  28. typedef unsigned long JET_HANDLE; /* backup file handle */
  29. typedef JET_ERR (__stdcall *JET_PFNSTATUS)(JET_SESID sesid, JET_SNP snp, JET_SNT snt, void *pv);
  30. typedef struct tagCONVERT
  31. {
  32. char *szOldDll;
  33. char *szOldSysDb;
  34. unsigned long fDbAttached; // Return value indicating if Db was attached
  35. } JET_CONVERT;
  36. typedef enum
  37. {
  38. opDBUTILConsistency,
  39. opDBUTILDumpData,
  40. opDBUTILDumpMetaData,
  41. opDBUTILDumpSpace,
  42. opDBUTILSetHeaderState,
  43. opDBUTILDumpHeader,
  44. opDBUTILDumpLogfile,
  45. opDBUTILDumpCheckpoint
  46. } DBUTIL_OP;
  47. typedef struct tagDBUTIL
  48. {
  49. unsigned long cbStruct;
  50. char *szDatabase;
  51. char *szTable;
  52. char *szIndex;
  53. DBUTIL_OP op;
  54. JET_GRBIT grbitOptions;
  55. } JET_DBUTIL;
  56. #define JET_bitDBUtilOptionAllNodes 0x00000001
  57. #define JET_bitDBUtilOptionKeyStats 0x00000002
  58. #define JET_bitDBUtilOptionPageDump 0x00000004
  59. #define JET_bitDBUtilOptionDumpVerbose 0x10000000 // DEBUG only
  60. #define JET_bitDBUtilOptionCheckBTree 0x20000000 // DEBUG only
  61. /* Session information bits */
  62. #define JET_bitCIMCommitted 0x00000001
  63. #define JET_bitCIMDirty 0x00000002
  64. #define JET_bitAggregateTransaction 0x00000008
  65. /* JetGetLastErrorInfo structure */
  66. typedef struct
  67. {
  68. unsigned long cbStruct; /* Size of this structure */
  69. JET_ERR err; /* Extended error code (if any) */
  70. unsigned long ul1; /* First general purpose integer */
  71. unsigned long ul2; /* Second general purpose integer */
  72. unsigned long ul3; /* Third general purpose integer */
  73. } JET_EXTERR;
  74. /* Status Notification Structures */
  75. typedef struct /* Status Notification Progress */
  76. {
  77. unsigned long cbStruct; /* Size of this structure */
  78. unsigned long cunitDone; /* Number of units of work completed */
  79. unsigned long cunitTotal; /* Total number of units of work */
  80. } JET_SNPROG;
  81. /* ErrCount Notification Structures */
  82. typedef struct /* Status Notification Progress */
  83. {
  84. unsigned long cbStruct; /* Size of this structure */
  85. unsigned long cRecUniqueKeyViolation;
  86. unsigned long cRecTypeConversionFail;
  87. unsigned long cRecRecordLocked;
  88. unsigned long cRecTotal; /* Total number of units of work */
  89. } JET_SNERRCNT;
  90. typedef struct /* Status Notification Message */
  91. {
  92. unsigned long cbStruct; /* Size of this structure */
  93. JET_SNC snc; /* Status Notification Code */
  94. unsigned long ul; /* Numeric identifier */
  95. char sz[256]; /* Identifier */
  96. } JET_SNMSG;
  97. typedef struct
  98. {
  99. unsigned long cbStruct;
  100. JET_OBJTYP objtyp;
  101. JET_DATESERIAL dtCreate;
  102. JET_DATESERIAL dtUpdate;
  103. JET_GRBIT grbit;
  104. unsigned long flags;
  105. unsigned long cRecord;
  106. unsigned long cPage;
  107. } JET_OBJECTINFO;
  108. /* required for Exchange to make RSTMAP RPC capable
  109. /**/
  110. #ifdef MIDL_PASS
  111. #define xRPC_STRING [string]
  112. #else
  113. #define xRPC_STRING
  114. #if !defined(_NATIVE_WCHAR_T_DEFINED)
  115. typedef unsigned short WCHAR;
  116. #else
  117. typedef wchar_t WCHAR;
  118. #endif
  119. #endif
  120. typedef struct
  121. {
  122. xRPC_STRING char *szDatabaseName;
  123. xRPC_STRING char *szNewDatabaseName;
  124. } JET_RSTMAP; /* restore map */
  125. /* required for Exchange unicode support
  126. /**/
  127. #define UNICODE_RSTMAP
  128. typedef struct tagJET_RSTMAPW {
  129. xRPC_STRING WCHAR *wszDatabaseName;
  130. xRPC_STRING WCHAR *wszNewDatabaseName;
  131. } JET_RSTMAPW, *PJET_RSTMAPW;
  132. /* The following flags appear in the grbit field above */
  133. #define JET_bitTableInfoUpdatable 0x00000001
  134. #define JET_bitTableInfoBookmark 0x00000002
  135. #define JET_bitTableInfoRollback 0x00000004
  136. #define JET_bitTableInfoRestartable 0x00000008
  137. #define JET_bitTableInfoNoInserts 0x00000010
  138. /* The following flags occur in the flags field above */
  139. #define JET_bitSaveUIDnPWD 0x20000000 /* this bit is only */
  140. /* appropriate for rmt links */
  141. #define JET_bitObjectExclusive 0x40000000 /* Open link exclusively */
  142. #define JET_bitObjectSystem 0x80000000
  143. typedef struct
  144. {
  145. unsigned long cbStruct;
  146. JET_TABLEID tableid;
  147. unsigned long cRecord;
  148. JET_COLUMNID columnidcontainername;
  149. JET_COLUMNID columnidobjectname;
  150. JET_COLUMNID columnidobjtyp;
  151. JET_COLUMNID columniddtCreate;
  152. JET_COLUMNID columniddtUpdate;
  153. JET_COLUMNID columnidgrbit;
  154. JET_COLUMNID columnidflags;
  155. JET_COLUMNID columnidcRecord; /* Level 2 info */
  156. JET_COLUMNID columnidcPage; /* Level 2 info */
  157. } JET_OBJECTLIST;
  158. #define cObjectInfoCols 9
  159. typedef struct
  160. {
  161. unsigned long cbStruct;
  162. JET_TABLEID tableid;
  163. unsigned long cRecord;
  164. JET_COLUMNID columnidSid;
  165. JET_COLUMNID columnidACM;
  166. JET_COLUMNID columnidgrbit; /* grbit from JetSetAccess */
  167. } JET_OBJECTACMLIST;
  168. #define cObjectAcmCols 3
  169. typedef struct
  170. {
  171. unsigned long cbStruct;
  172. JET_TABLEID tableid;
  173. unsigned long cRecord;
  174. JET_COLUMNID columnidPresentationOrder;
  175. JET_COLUMNID columnidcolumnname;
  176. JET_COLUMNID columnidcolumnid;
  177. JET_COLUMNID columnidcoltyp;
  178. JET_COLUMNID columnidCountry;
  179. JET_COLUMNID columnidLangid;
  180. JET_COLUMNID columnidCp;
  181. JET_COLUMNID columnidCollate;
  182. JET_COLUMNID columnidcbMax;
  183. JET_COLUMNID columnidgrbit;
  184. JET_COLUMNID columnidDefault;
  185. JET_COLUMNID columnidBaseTableName;
  186. JET_COLUMNID columnidBaseColumnName;
  187. JET_COLUMNID columnidDefinitionName;
  188. } JET_COLUMNLIST;
  189. #define cColumnInfoCols 14
  190. typedef struct
  191. {
  192. unsigned long cbStruct;
  193. JET_COLUMNID columnid;
  194. JET_COLTYP coltyp;
  195. unsigned short wCountry;
  196. unsigned short langid;
  197. unsigned short cp;
  198. unsigned short wCollate; /* Must be 0 */
  199. unsigned long cbMax;
  200. JET_GRBIT grbit;
  201. } JET_COLUMNDEF;
  202. typedef struct
  203. {
  204. unsigned long cbStruct;
  205. JET_COLUMNID columnid;
  206. JET_COLTYP coltyp;
  207. unsigned short wCountry;
  208. unsigned short langid;
  209. unsigned short cp;
  210. unsigned short wFiller; /* Must be 0 */
  211. unsigned long cbMax;
  212. JET_GRBIT grbit;
  213. char szBaseTableName[256];
  214. char szBaseColumnName[256];
  215. } JET_COLUMNBASE;
  216. typedef struct
  217. {
  218. unsigned long cbStruct;
  219. JET_TABLEID tableid;
  220. unsigned long cRecord;
  221. JET_COLUMNID columnidindexname;
  222. JET_COLUMNID columnidgrbitIndex;
  223. JET_COLUMNID columnidcKey;
  224. JET_COLUMNID columnidcEntry;
  225. JET_COLUMNID columnidcPage;
  226. JET_COLUMNID columnidcColumn;
  227. JET_COLUMNID columnidiColumn;
  228. JET_COLUMNID columnidcolumnid;
  229. JET_COLUMNID columnidcoltyp;
  230. JET_COLUMNID columnidCountry;
  231. JET_COLUMNID columnidLangid;
  232. JET_COLUMNID columnidCp;
  233. JET_COLUMNID columnidCollate;
  234. JET_COLUMNID columnidgrbitColumn;
  235. JET_COLUMNID columnidcolumnname;
  236. } JET_INDEXLIST;
  237. typedef struct tag_JET_COLUMNCREATE
  238. {
  239. unsigned long cbStruct; // size of this structure (for future expansion)
  240. char *szColumnName; // column name
  241. JET_COLTYP coltyp; // column type
  242. unsigned long cbMax; // the maximum length of this column (only relevant for binary and text columns)
  243. JET_GRBIT grbit; // column options
  244. void *pvDefault; // default value (NULL if none)
  245. unsigned long cbDefault; // length of default value
  246. unsigned long cp; // code page (for text columns only)
  247. JET_COLUMNID columnid; // returned column id
  248. JET_ERR err; // returned error code
  249. } JET_COLUMNCREATE;
  250. typedef struct tagJET_INDEXCREATE
  251. {
  252. unsigned long cbStruct; // size of this structure (for future expansion)
  253. char *szIndexName; // index name
  254. char *szKey; // index key
  255. unsigned long cbKey; // length of key
  256. JET_GRBIT grbit; // index options
  257. unsigned long ulDensity; // index density
  258. JET_ERR err; // returned error code
  259. } JET_INDEXCREATE;
  260. typedef struct tagJET_TABLECREATE
  261. {
  262. unsigned long cbStruct; // size of this structure (for future expansion)
  263. char *szTableName; // name of table to create.
  264. unsigned long ulPages; // initial pages to allocate for table.
  265. unsigned long ulDensity; // table density.
  266. JET_COLUMNCREATE *rgcolumncreate; // array of column creation info
  267. unsigned long cColumns; // number of columns to create
  268. JET_INDEXCREATE *rgindexcreate; // array of index creation info
  269. unsigned long cIndexes; // number of indexes to create
  270. JET_GRBIT grbit; // Abort column/index creation on error?
  271. JET_TABLEID tableid; // returned tableid.
  272. unsigned long cCreated; // count of objects created (columns+table+indexes).
  273. } JET_TABLECREATE;
  274. #define cIndexInfoCols 15
  275. typedef struct
  276. {
  277. unsigned long cbStruct;
  278. JET_TABLEID tableid;
  279. unsigned long cRecord;
  280. JET_COLUMNID columnidReferenceName;
  281. JET_COLUMNID columnidgrbit;
  282. JET_COLUMNID columnidcColumn;
  283. JET_COLUMNID columnidiColumn;
  284. JET_COLUMNID columnidReferencingTableName;
  285. JET_COLUMNID columnidReferencingColumnName;
  286. JET_COLUMNID columnidReferencedTableName;
  287. JET_COLUMNID columnidReferencedColumnName;
  288. } JET_RELATIONSHIPLIST;
  289. /* for backward compatibility */
  290. typedef JET_RELATIONSHIPLIST JET_REFERENCELIST;
  291. #define cReferenceInfoCols 8
  292. typedef struct
  293. {
  294. unsigned long cbStruct;
  295. unsigned long ibLongValue;
  296. unsigned long itagSequence;
  297. JET_COLUMNID columnidNextTagged;
  298. } JET_RETINFO;
  299. typedef struct
  300. {
  301. unsigned long cbStruct;
  302. unsigned long ibLongValue;
  303. unsigned long itagSequence;
  304. } JET_SETINFO;
  305. typedef struct
  306. {
  307. unsigned long cbStruct;
  308. unsigned long centriesLT;
  309. unsigned long centriesInRange;
  310. unsigned long centriesTotal;
  311. } JET_RECPOS;
  312. typedef struct
  313. {
  314. unsigned long cDiscont;
  315. unsigned long cUnfixedMessyPage;
  316. unsigned long centriesLT;
  317. unsigned long centriesTotal;
  318. unsigned long cpgCompactFreed;
  319. } JET_OLCSTAT;
  320. typedef struct
  321. {
  322. unsigned long ctableid;
  323. JET_TABLEID rgtableid[1];
  324. } JET_MGBLIST;
  325. /*** Property Manager Structure ***/
  326. typedef struct
  327. {
  328. unsigned long cbStruct;
  329. JET_TABLEID tableid;
  330. JET_COLUMNID columnidColumnName;
  331. JET_COLUMNID columnidPropertyName;
  332. JET_COLUMNID columnidGrbit;
  333. JET_COLUMNID columnidPropertyValue;
  334. JET_COLUMNID columnidColtyp;
  335. } JET_PROPERTYLIST;
  336. /************************************************************************/
  337. /************************* JET CONSTANTS ************************/
  338. /************************************************************************/
  339. #define JET_tableidNil ((JET_TABLEID) 0xFFFFFFFF)
  340. #define JET_sesidNil ((JET_SESID) 0xFFFFFFFF)
  341. /* Max size of a bookmark */
  342. #define JET_cbBookmarkMost 4
  343. /* Max length of a object/column/index/property name */
  344. #define JET_cbNameMost 64
  345. /* Max length of a "name.name.name..." construct */
  346. #define JET_cbFullNameMost 255
  347. /* Max size of long-value column chunk */
  348. #define JET_cbColumnLVChunkMost 4035
  349. /* Max size of non-long-value column data */
  350. #define JET_cbColumnMost 255
  351. /* Max size of a sort/index key */
  352. #define JET_cbKeyMost 255
  353. /* Max number of components in a sort/index key */
  354. #define JET_ccolKeyMost 12
  355. /* Max number of columns in a table/query */
  356. #define JET_ccolTableMost 255
  357. /* Max Length of a property in the property manager */
  358. #define JET_cbPropertyMost 2048
  359. /* Largest initial substring of a long value used in an expression */
  360. #define JET_cbExprLVMost 0x8000L /*** 32 K ***/
  361. /* Max size of returned (from SQLDriverConnect) conn string */
  362. #define JET_cbConnectMost 255
  363. /* Max number of levels in an MGB */
  364. #define JET_wGroupLevelMax 12
  365. /* Size restrictions for Pins */
  366. #define JET_cchPINMax 20
  367. #define JET_cchPINMin 4
  368. /* System parameter codes for JetSetSystemParameter */
  369. /* not supported */
  370. #define JET_paramPfnStatus 2 /* Status callback function */
  371. #define JET_paramPfnError 3 /* Error callback function */
  372. #define JET_paramHwndODBC 4 /* Window handle for ODBC use */
  373. #define JET_paramIniPath 5 /* Path to the ini file */
  374. #define JET_paramPageTimeout 6 /* Red ISAM page timeout value */
  375. #define JET_paramODBCQueryTimeout 7 /* ODBC async query timeout value */
  376. #define JET_paramODBCLoginTimeout 25 /* ODBC connection attempt timeout value */
  377. #define JET_paramExprObject 26 /* Expression Evaluation callback */
  378. #define JET_paramGetTypeComp 27 /* Expression Evaluation callback */
  379. #define JET_paramHostVersion 28 /* Host Version callback */
  380. #define JET_paramSQLTraceMode 29 /* Enable/disable SQL tracing */
  381. #define JET_paramEventId 46 /* NT event id */
  382. #define JET_paramEventCategory 47 /* NT event category */
  383. #define JET_paramRmtXactIsolation 39 /* Do not share connections with other sessions */
  384. #define JET_paramJetInternal 35 /* Whether internal to JET; if set, allows ISAM to do things which are prevented in general */
  385. #define JET_paramFullQJet 38 /* Allow full QJet functionality */
  386. #define JET_paramLogFlushThreshold 18 /* log buffer flush threshold in 512 bytes [10] */
  387. #define JET_paramLogFlushPeriod 22 /* log flush period in miliseconds [45] */
  388. #define JET_paramOnLineCompact 37 /* Options for compact pages on-line */
  389. #define JET_paramRecovery 30 /* Switch for log on/off */
  390. /* debug only not supported */
  391. #define JET_paramTransactionLevel 32 /* Transaction level of session */
  392. #define JET_paramAssertAction 44 /* debug only determines action on assert */
  393. #define JET_paramPrintFunction 49 /* debug only. synched print function */
  394. #define JET_paramRFS2IOsPermitted 54 /* # IOs permitted to succeed (-1 = all) */
  395. #define JET_paramRFS2AllocsPermitted 55 /* # allocs permitted to success (-1 = all) */
  396. /* fully supported parameters */
  397. /* Note that one page = 4kBytes.
  398. /**/
  399. #define JET_paramSysDbPath 0 /* path to the system database (defunct) ["<base name>.<base ext>"] */
  400. #define JET_paramSystemPath 0 /* path to check point file ["."] */
  401. #define JET_paramTempPath 1 /* path to the temporary database ["."] */
  402. #define JET_paramMaxBuffers 8 /* maximum page cache size in pages [512] */
  403. #define JET_paramMaxSessions 9 /* maximum number of sessions [128] */
  404. #define JET_paramMaxOpenTables 10 /* maximum number of open tables [300] */
  405. #define JET_paramPreferredMaxOpenTables 59 /* prefered maximum number of open tables [300] */
  406. #define JET_paramMaxVerPages 11 /* maximum version store size in 16KB buckets [64] */
  407. #define JET_paramMaxCursors 12 /* maximum number of open cursors [1024] */
  408. #define JET_paramLogFilePath 13 /* path to the log file directory ["."] */
  409. #define JET_paramMaxOpenTableIndexes 14 /* maximum open table indexes [300] */
  410. #define JET_paramMaxTemporaryTables 15 /* maximum concurrent JetCreateIndex [20] */
  411. #define JET_paramLogBuffers 16 /* maximum log buffers in 512 bytes [21] */
  412. #define JET_paramLogFileSize 17 /* maximum log file size in kBytes [5120] */
  413. #define JET_paramBfThrshldLowPrcnt 19 /* low percentage clean buffer flush start [20] */
  414. #define JET_paramBfThrshldHighPrcnt 20 /* high percentage clean buffer flush stop [80] */
  415. #define JET_paramWaitLogFlush 21 /* log flush wait time in milliseconds [15] */
  416. #define JET_paramLogCheckpointPeriod 23 /* checkpoint period in 512 bytes [1024] */
  417. #define JET_paramLogWaitingUserMax 24 /* maximum sessions waiting log flush [3] */
  418. #define JET_paramSessionInfo 33 /* per session information [0] */
  419. #define JET_paramPageFragment 34 /* maximum disk extent considered fragment in pages [8] */
  420. #define JET_paramMaxOpenDatabases 36 /* maximum number of open databases [100] */
  421. #define JET_paramBufBatchIOMax 41 /* maximum batch IO in pages [64] */
  422. #define JET_paramPageReadAheadMax 42 /* maximum read-ahead IO in pages [20] */
  423. #define JET_paramAsynchIOMax 43 /* maximum asynchronous IO in pages [64] */
  424. #define JET_paramEventSource 45 /* language independant process descriptor string [""] */
  425. #define JET_paramDbExtensionSize 48 /* database extension size in pages [16] */
  426. #define JET_paramCommitDefault 50 /* default grbit for JetCommitTransaction [0] */
  427. #define JET_paramBufLogGenAgeThreshold 51 /* age threshold in log files [2] */
  428. #define JET_paramCircularLog 52 /* boolean flag for circular logging [0] */
  429. #define JET_paramPageTempDBMin 53 /* minimum size temporary database in pages [0] */
  430. #define JET_paramBaseName 56 /* base name for all DBMS object names ["edb"] */
  431. #define JET_paramBaseExtension 57 /* base extension for all DBMS object names ["edb"] */
  432. #define JET_paramTableClassName 58 /* table stats class name (class #, string) */
  433. /* Flags for JetTerm2 */
  434. #define JET_bitTermComplete 0x00000001
  435. #define JET_bitTermAbrupt 0x00000002
  436. /* Flags for JetIdle */
  437. #define JET_bitIdleRemoveReadLocks 0x00000001
  438. #define JET_bitIdleFlushBuffers 0x00000002
  439. #define JET_bitIdleCompact 0x00000004
  440. #define JET_bitIdleStatus 0x80000000
  441. /* Flags for JetEndSession */
  442. #define JET_bitForceSessionClosed 0x00000001
  443. /* Flags for JetOpenDatabase */
  444. #define JET_bitDbReadOnly 0x00000001
  445. #define JET_bitDbExclusive 0x00000002 /* multiple opens allowed */
  446. #define JET_bitDbRemoteSilent 0x00000004
  447. #define JET_bitDbSingleExclusive 0x00000008 /* opened exactly once */
  448. /* Flags for JetCloseDatabase */
  449. #define JET_bitDbForceClose 0x00000001
  450. /* Flags for JetCreateDatabase */
  451. #define JET_bitDbVersion10 0x00000002 /* INTERNAL USE ONLY */
  452. #define JET_bitDbVersion1x 0x00000004
  453. #define JET_bitDbRecoveryOff 0x00000008 /* disable logging/recovery for this database */
  454. #define JET_bitDbNoLogging JET_bitDbRecoveryOff
  455. #define JET_bitDbCompleteConnstr 0x00000020
  456. #define JET_bitDbVersioningOff 0x00000040
  457. /* Flags for JetBackup */
  458. #define JET_bitBackupIncremental 0x00000001
  459. #define JET_bitKeepOldLogs 0x00000002
  460. #define JET_bitBackupAtomic 0x00000004
  461. /* Database types */
  462. #define JET_dbidNil ((JET_DBID) 0xFFFFFFFF)
  463. #define JET_dbidNoValid ((JET_DBID) 0xFFFFFFFE) /* used as a flag to indicate that there is no valid dbid */
  464. /* Flags for JetCreateLink */
  465. /* Can use JET_bitObjectExclusive to cause linked to database to be opened */
  466. /* exclusively. */
  467. /* Flags for JetCreateTableColumnIndex */
  468. #define JET_bitTableCreateCheckColumnNames 0x00000001 /* Ensures that each column
  469. /* specified in the JET_COLUMNCREATE
  470. /* array has a unique name
  471. /* (for performance reasons,
  472. /* the default is to NOT perform
  473. /* this check and rely on the
  474. /* function caller to ensure
  475. /* column name uniqueness).
  476. /**/
  477. #define JET_bitTableCreateCompaction 0x40000000 /* Internal grbit used when
  478. /* creating a table during
  479. /* off-line compact.
  480. /**/
  481. #define JET_bitTableCreateSystemTable 0x80000000 /* Internal grbit used when
  482. /* creating system tables.
  483. /**/
  484. /* Flags for JetAddColumn, JetGetColumnInfo, JetOpenTempTable */
  485. #define JET_bitColumnFixed 0x00000001
  486. #define JET_bitColumnTagged 0x00000002
  487. #define JET_bitColumnNotNULL 0x00000004
  488. #define JET_bitColumnVersion 0x00000008
  489. #define JET_bitColumnAutoincrement 0x00000010
  490. #define JET_bitColumnUpdatable 0x00000020 /* JetGetColumnInfo only */
  491. #define JET_bitColumnTTKey 0x00000040 /* JetOpenTempTable only */
  492. #define JET_bitColumnTTDescending 0x00000080 /* JetOpenTempTable only */
  493. #define JET_bitColumnNotLast 0x00000100 /* Installable ISAM option */
  494. #define JET_bitColumnRmtGraphic 0x00000200 /* JetGetColumnInfo */
  495. #define JET_bitColumnMultiValued 0x00000400
  496. #define JET_bitColumnColumnGUID 0x00000800
  497. #define JET_bitColumnMostMany 0x00001000
  498. #define JET_bitColumnPreventDelete 0x00002000
  499. /* Flags for JetSetCurrentIndex */
  500. #define JET_bitMoveFirst 0x00000000
  501. #define JET_bitMoveBeforeFirst 0x00000001
  502. #define JET_bitNoMove 0x00000002
  503. /* Flags for JetMakeKey */
  504. #define JET_bitNewKey 0x00000001
  505. #define JET_bitStrLimit 0x00000002
  506. #define JET_bitSubStrLimit 0x00000004
  507. #define JET_bitNormalizedKey 0x00000008
  508. #define JET_bitKeyDataZeroLength 0x00000010
  509. #ifdef DBCS /* johnta: LIKE "ABC" not converted to ="ABC" for Japanese */
  510. #define JET_bitLikeExtra1 0x00000020
  511. #endif /* DBCS */
  512. /* Flags for ErrDispSetIndexRange */
  513. #define JET_bitRangeInclusive 0x00000001
  514. #define JET_bitRangeUpperLimit 0x00000002
  515. #define JET_bitRangeInstantDuration 0x00000004
  516. #define JET_bitRangeRemove 0x00000008
  517. /* Constants for JetMove */
  518. #define JET_MoveFirst (0x80000000)
  519. #define JET_MovePrevious (-1)
  520. #define JET_MoveNext (+1)
  521. #define JET_MoveLast (0x7fffffff)
  522. /* Flags for JetMove */
  523. #define JET_bitMoveKeyNE 0x00000001
  524. #define JET_bitMoveCheckTS 0x00000002
  525. #define JET_bitMoveInPage 0x00000004
  526. /* Flags for JetSeek */
  527. #define JET_bitSeekEQ 0x00000001
  528. #define JET_bitSeekLT 0x00000002
  529. #define JET_bitSeekLE 0x00000004
  530. #define JET_bitSeekGE 0x00000008
  531. #define JET_bitSeekGT 0x00000010
  532. #define JET_bitSetIndexRange 0x00000020
  533. /* Flags for JetFastFind */
  534. #define JET_bitFFindBackwards 0x00000001
  535. #define JET_bitFFindFromCursor 0x00000004
  536. /* Flags for JetCreateIndex */
  537. #define JET_bitIndexUnique 0x00000001
  538. #define JET_bitIndexPrimary 0x00000002
  539. #define JET_bitIndexDisallowNull 0x00000004
  540. #define JET_bitIndexIgnoreNull 0x00000008
  541. #define JET_bitIndexClustered 0x00000010
  542. #define JET_bitIndexIgnoreAnyNull 0x00000020
  543. #define JET_bitIndexIgnoreFirstNull 0x00000040
  544. #define JET_bitIndexLazyFlush 0x00000080
  545. #define JET_bitIndexEmptyTable 0x40000000 // Internal use only
  546. #define JET_bitIndexReference 0x80000000 /* IndexInfo only */
  547. /* Flags for index key definition */
  548. #define JET_bitKeyAscending 0x00000000
  549. #define JET_bitKeyDescending 0x00000001
  550. /* Flags for JetCreateRelationship */
  551. #define JET_bitRelationUnique 0x00000001
  552. #define JET_bitRelationDontEnforce 0x00000002
  553. #define JET_bitRelationInherited 0x00000004
  554. #define JET_bitRelationTestLegal 0x00000008 /* don't create relationship */
  555. #define JET_bitRelationshipMatchMask 0x000000F0
  556. #define JET_bitRelationMatchDefault 0x00000000
  557. #define JET_bitRelationMatchFull 0x00000010
  558. #define JET_bitRelationUpdateActionMask 0x00000F00
  559. #define JET_bitRelationUpdateDisallow 0x00000000
  560. #define JET_bitRelationUpdateCascade 0x00000100
  561. #define JET_bitRelationUpdateSetNull 0x00000200
  562. #define JET_bitRelationUpdateSetDefault 0x00000300
  563. #define JET_bitRelationDeleteActionMask 0x0000F000
  564. #define JET_bitRelationDeleteDisallow 0x00000000
  565. #define JET_bitRelationDeleteCascade 0x00001000
  566. #define JET_bitRelationDeleteSetNull 0x00002000
  567. #define JET_bitRelationDeleteSetDefault 0x00003000
  568. #define JET_bitRelationUserMask 0xFF000000 /* non-enforced values */
  569. #define JET_bitRelationJoinMask 0x03000000
  570. #define JET_bitRelationInner 0x00000000
  571. #define JET_bitRelationLeft 0x01000000
  572. #define JET_bitRelationRight 0x02000000
  573. /* Flags for JetCreateReference/JetCreateRelationship */
  574. /* NOTE: use the bitRelationship flags instead! */
  575. #define JET_ReferenceUnique JET_bitRelationUnique
  576. #define JET_ReferenceDontEnforce JET_bitRelationDontEnforce
  577. #define JET_ReferenceMatchTypeMask JET_bitRelationMatchMask
  578. #define JET_ReferenceMatchDefault JET_bitRelationMatchDefault
  579. #define JET_ReferenceMatchFull JET_bitRelationMatchFull
  580. #define JET_ReferenceUpdateActionMask JET_bitRelationUpdateActionMask
  581. #define JET_ReferenceUpdateDisallow JET_bitRelationUpdateDisallow
  582. #define JET_ReferenceUpdateCascade JET_bitRelationUpdateCascade
  583. #define JET_ReferenceUpdateSetNull JET_bitRelationUpdateSetNull
  584. #define JET_ReferenceUpdateSetDefault JET_bitRelationUpdateSetDefault
  585. #define JET_ReferenceDeleteActionMask JET_bitRelationDeleteActionMask
  586. #define JET_ReferenceDeleteDisallow JET_bitRelationDeleteDisallow
  587. #define JET_ReferenceDeleteCascade JET_bitRelationDeleteCascade
  588. #define JET_ReferenceDeleteSetNull JET_bitRelationDeleteSetNull
  589. #define JET_ReferenceDeleteSetDefault JET_bitRelationDeleteSetDefault
  590. /* Flags for JetOpenTable */
  591. #define JET_bitTableDenyWrite 0x00000001
  592. #define JET_bitTableDenyRead 0x00000002
  593. #define JET_bitTableReadOnly 0x00000004
  594. #define JET_bitTableAppendOnly 0x00000008
  595. #define JET_bitTableUpdatable 0x00000010
  596. #define JET_bitTableScrollable 0x00000020
  597. #define JET_bitTableFixedSet 0x00000040 /* Fixed working set */
  598. #define JET_bitTableInconsistent 0x00000080
  599. #define JET_bitTableBulk 0x00000100
  600. #define JET_bitTableUsePrimaryIndex 0x00000200 /* Use with FixedSet */
  601. #define JET_bitTableSampleData 0x00000400
  602. #define JET_bitTableQuickBrowse 0x00000800 /* Bias optimizer toward index usage */
  603. #define JET_bitTableDDL 0x00001000 /* similar to JET_bitTableBulk, for DDL */
  604. #define JET_bitTablePassThrough 0x00002000 /* Remote DBs Only */
  605. #define JET_bitTableRowReturning 0x00004000
  606. #define JET_bitTableSequential 0x00008000 /* Intend to access table sequentially */
  607. #define JET_bitTableClassMask 0x000F0000 /* table stats class mask */
  608. #define JET_bitTableClassNone 0x00000000 /* table belongs to no stats class (default) */
  609. #define JET_bitTableClass1 0x00010000 /* table belongs to stats class 1 */
  610. #define JET_bitTableClass2 0x00020000 /* table belongs to stats class 2 */
  611. #define JET_bitTableClass3 0x00030000 /* table belongs to stats class 3 */
  612. #define JET_bitTableClass4 0x00040000 /* table belongs to stats class 4 */
  613. #define JET_bitTableClass5 0x00050000 /* table belongs to stats class 5 */
  614. #define JET_bitTableClass6 0x00060000 /* table belongs to stats class 6 */
  615. #define JET_bitTableClass7 0x00070000 /* table belongs to stats class 7 */
  616. #define JET_bitTableClass8 0x00080000 /* table belongs to stats class 8 */
  617. #define JET_bitTableClass9 0x00090000 /* table belongs to stats class 9 */
  618. #define JET_bitTableClass10 0x000A0000 /* table belongs to stats class 10 */
  619. #define JET_bitTableClass11 0x000B0000 /* table belongs to stats class 11 */
  620. #define JET_bitTableClass12 0x000C0000 /* table belongs to stats class 12 */
  621. #define JET_bitTableClass13 0x000D0000 /* table belongs to stats class 13 */
  622. #define JET_bitTableClass14 0x000E0000 /* table belongs to stats class 14 */
  623. #define JET_bitTableClass15 0x000F0000 /* table belongs to stats class 15 */
  624. /* Flags for JetSetQoSql/JetRetrieveQoSql */
  625. #define JET_bitSqlPassThrough 0x00000001 /* Pass through Query returning records */
  626. #define JET_bitSqlSPTBulkOp 0x00000002 /* SPT query returning no table */
  627. /* Flags for JetOpenVtQbe */
  628. #define JET_bitQBEAddBrackets 0x00000001
  629. #define JET_bitQBERemoveEquals 0x00000002
  630. /* Flags for JetOpenTempTable and ErrIsamOpenTempTable */
  631. #define JET_bitTTIndexed 0x00000001 /* Allow seek */
  632. #define JET_bitTTUnique 0x00000002 /* Remove duplicates */
  633. #define JET_bitTTUpdatable 0x00000004 /* Allow updates */
  634. #define JET_bitTTScrollable 0x00000008 /* Allow backwards scrolling */
  635. /* Flags for JetSetColumn */
  636. #define JET_bitSetAppendLV 0x00000001
  637. #define JET_bitSetValidate 0x00000002
  638. #define JET_bitSetOverwriteLV 0x00000004 /* overwrite JET_coltypLong* byte range */
  639. #define JET_bitSetSizeLV 0x00000008 /* set JET_coltypLong* size */
  640. #define JET_bitSetValidateColumn 0x00000010
  641. #define JET_bitSetZeroLength 0x00000020
  642. #define JET_bitSetSeparateLV 0x00000040 /* force LV separation */
  643. #define JET_bitSetNoVersion 0x00000080 /* INTERNAL USE ONLY */
  644. /* Set column parameter structure for JetSetColumns */
  645. typedef struct {
  646. JET_COLUMNID columnid;
  647. const void *pvData;
  648. unsigned long cbData;
  649. JET_GRBIT grbit;
  650. unsigned long ibLongValue;
  651. unsigned long itagSequence;
  652. JET_ERR err;
  653. } JET_SETCOLUMN;
  654. /* Options for JetPrepareUpdate */
  655. #define JET_prepInsert 0
  656. #define JET_prepInsertBeforeCurrent 1
  657. #define JET_prepReplace 2
  658. #define JET_prepCancel 3
  659. #define JET_prepReplaceNoLock 4
  660. #define JET_prepInsertCopy 5
  661. /* Flags for JetRetrieveColumn */
  662. #define JET_bitRetrieveCopy 0x00000001
  663. #define JET_bitRetrieveFromIndex 0x00000002
  664. #define JET_bitRetrieveCase 0x00000004
  665. #define JET_bitRetrieveTag 0x00000008
  666. #define JET_bitRetrieveNull 0x00000010 /* for columnid 0 only */
  667. #define JET_bitRetrieveIgnoreDefault 0x00000020 /* for columnid 0 only */
  668. #define JET_bitRetrieveLongId 0x00000040
  669. #define JET_bitRetrieveRecord 0x80000000
  670. #define JET_bitRetrieveFDB 0x40000000
  671. #define JET_bitRetrieveBookmarks 0x20000000
  672. /* Retrieve column parameter structure for JetRetrieveColumns */
  673. typedef struct {
  674. JET_COLUMNID columnid;
  675. void *pvData;
  676. unsigned long cbData;
  677. unsigned long cbActual;
  678. JET_GRBIT grbit;
  679. unsigned long ibLongValue;
  680. unsigned long itagSequence;
  681. JET_COLUMNID columnidNextTagged;
  682. JET_ERR err;
  683. } JET_RETRIEVECOLUMN;
  684. /* Flags for JetFillFatCursor */
  685. #define JET_bitFCFillRange 0x00000001
  686. #define JET_bitFCRefreshRange 0x00000002
  687. #define JET_bitFCFillMemos 0x00000004
  688. /* Flags for JetCommitTransaction */
  689. #define JET_bitCommitFlush 0x00000001 /* commit and flush page buffers. */
  690. #define JET_bitCommitLazyFlush 0x00000004 /* lazy flush log buffers. */
  691. #define JET_bitWaitLastLevel0Commit 0x00000010 /* wait for last level 0 commit record flushed */
  692. /* Flags for JetRollback */
  693. #define JET_bitRollbackAll 0x00000001
  694. /* Flags for JetSetAccess and JetGetAccess */
  695. #define JET_bitACEInheritable 0x00000001
  696. /* Flags for JetCreateSystemDatabase */
  697. #define JET_bitSysDbOverwrite 0x00000001
  698. /* Flags for Jet Property Management */
  699. #define JET_bitPropDDL 0x00000001 /* also used for setting */
  700. #define JET_bitPropInherited 0x00000002 /* not used for setting */
  701. /* JPM Flags that are only used for setting properties */
  702. #define JET_bitPropReplaceOnly 0x00000010
  703. #define JET_bitPropInsertOnly 0x00000020
  704. #define JET_bitPropDeleteOnly 0x00000040
  705. /* InfoLevels for Jet Property Management */
  706. #define JET_PropertyValue 0
  707. #define JET_PropertyCount 1
  708. #define JET_PropertySingleCollection 2
  709. #define JET_PropertyAllCollections 3
  710. /* Collate values for JetGetColumnInfo and JetGetIndexInfo */
  711. #define JET_sortBinary 0x0000
  712. #define JET_sortEFGPI 0x0100
  713. #define JET_sortSNIFD 0x0101
  714. #define JET_sortSpanish 0x0102
  715. #define JET_sortDutch 0x0103
  716. #define JET_sortSweFin 0x0104
  717. #define JET_sortNorDan 0x0105
  718. #define JET_sortIcelandic 0x0106
  719. #define JET_sortCyrillic 0x0107
  720. #define JET_sortCzech 0x0108
  721. #define JET_sortHungarian 0x0109
  722. #define JET_sortPolish 0x010A
  723. #define JET_sortArabic 0x010B
  724. #define JET_sortHebrew 0x010C
  725. #define JET_sortMax 0x010C /* Max for nonDBCS sort orders */
  726. #ifdef DBCS /* johnta: Add the new Japanese sorting order */
  727. #define JET_sortJapanese 0x010D
  728. #endif /* DBCS */
  729. #define JET_sortUnknown 0xFFFF
  730. /* Paradox ISAM specific collate values */
  731. #define JET_sortPdxIntl 0x1000
  732. #define JET_sortPdxSwedFin 0x1001
  733. #define JET_sortPdxNorDan 0x1002
  734. /* Info parameter for JetGetDatabaseInfo */
  735. #define JET_DbInfoFilename 0
  736. #define JET_DbInfoConnect 1
  737. #define JET_DbInfoCountry 2
  738. #define JET_DbInfoLangid 3
  739. #define JET_DbInfoCp 4
  740. #define JET_DbInfoCollate 5
  741. #define JET_DbInfoOptions 6
  742. #define JET_DbInfoTransactions 7
  743. #define JET_DbInfoVersion 8
  744. #define JET_DbInfoIsam 9
  745. #define JET_DbInfoFilesize 10
  746. #define JET_DbInfoSpaceOwned 11
  747. #define JET_DbInfoSpaceAvailable 12
  748. /* Database versions returned by JetGetDatabaseInfo */
  749. #define JET_DbVersion10 0x00010000
  750. #define JET_DbVersion11 0x00010001
  751. #define JET_DbVersion20 0x00020000
  752. /* Isam specific info returned by JetGetDatabaseInfo */
  753. #define JET_IsamInvalid 0
  754. #define JET_IsamBuiltinRed 1
  755. #define JET_IsamBuiltinBlue 2
  756. #define JET_IsamInstRed 21
  757. #define JET_IsamInstBlue 22
  758. #define JET_IsamInstFox 23
  759. #define JET_IsamInstParadox 24
  760. #define JET_IsamInstDbase 25
  761. #define JET_IsamInstBtrieve 26
  762. #define JET_IsamBuilinMost JET_BuiltinBlue
  763. #define JET_IsamInstMin JET_IsamInstRed
  764. #define JET_IsamInstMost JET_IsamInstBtrieve
  765. /* Link specific info for link identification */
  766. #define JET_bitLinkInvalid 0x00000000
  767. #define JET_bitLinkRemote 0x00100000
  768. #define JET_bitLinkBuiltinRed 0x00200000
  769. #define JET_bitLinkBuiltinBlue 0x00300000
  770. #define JET_bitLinkInstRed 0x00400000
  771. #define JET_bitLinkInstBlue 0x00500000
  772. #define JET_bitLinkInstFox 0x00600000
  773. #define JET_bitLinkInstParadox 0x00700000
  774. #define JET_bitLinkInstDbase 0x00800000
  775. #define JET_bitLinkInstBtrieve 0x00900000
  776. #define JET_bitFourByteBookmark 0x00000001
  777. #define JET_bitContiguousBookmarks 0x00000002
  778. /* Column data types */
  779. #define JET_coltypNil 0
  780. #define JET_coltypBit 1 /* True or False, Never NULL */
  781. #define JET_coltypUnsignedByte 2 /* 1-byte integer, unsigned */
  782. #define JET_coltypShort 3 /* 2-byte integer, signed */
  783. #define JET_coltypLong 4 /* 4-byte integer, signed */
  784. #define JET_coltypCurrency 5 /* 8 byte integer, signed */
  785. #define JET_coltypIEEESingle 6 /* 4-byte IEEE single precision */
  786. #define JET_coltypIEEEDouble 7 /* 8-byte IEEE double precision */
  787. #define JET_coltypDateTime 8 /* Integral date, fractional time */
  788. #define JET_coltypBinary 9 /* Binary data, < 255 bytes */
  789. #define JET_coltypText 10 /* ANSI text, case insensitive, < 255 bytes */
  790. #define JET_coltypLongBinary 11 /* Binary data, long value */
  791. #define JET_coltypLongText 12 /* ANSI text, long value */
  792. #define JET_coltypDatabase 13 /* Database name parameter */
  793. #define JET_coltypTableid 14 /* Tableid parameter */
  794. #define JET_coltypOLE 15 /* OLE blob */
  795. #define JET_coltypGUID 15
  796. #define JET_coltypMax 16 /* the number of column types */
  797. /* used for validity tests and */
  798. /* array declarations. */
  799. /* Info levels for JetGetObjectInfo */
  800. #define JET_ObjInfo 0U
  801. #define JET_ObjInfoListNoStats 1U
  802. #define JET_ObjInfoList 2U
  803. #define JET_ObjInfoSysTabCursor 3U
  804. #define JET_ObjInfoListACM 4U /* Blocked by JetGetObjectInfo */
  805. #define JET_ObjInfoNoStats 5U
  806. #define JET_ObjInfoSysTabReadOnly 6U
  807. #define JET_ObjInfoRulesLoaded 7U
  808. #define JET_ObjInfoMax 8U
  809. /* Info levels for JetGetTableInfo */
  810. #define JET_TblInfo 0U
  811. #define JET_TblInfoName 1U
  812. #define JET_TblInfoDbid 2U
  813. #define JET_TblInfoMostMany 3U
  814. #define JET_TblInfoRvt 4U
  815. #define JET_TblInfoOLC 5U
  816. #define JET_TblInfoResetOLC 6U
  817. #define JET_TblInfoSpaceUsage 7U
  818. #define JET_TblInfoDumpTable 8U
  819. #define JET_TblInfoSpaceAlloc 9U
  820. #define JET_TblInfoSpaceOwned 10U // OwnExt
  821. #define JET_TblInfoSpaceAvailable 11U // AvailExt
  822. /* Info levels for JetGetIndexInfo and JetGetTableIndexInfo */
  823. #define JET_IdxInfo 0U
  824. #define JET_IdxInfoList 1U
  825. #define JET_IdxInfoSysTabCursor 2U
  826. #define JET_IdxInfoOLC 3U
  827. #define JET_IdxInfoResetOLC 4U
  828. #define JET_IdxInfoSpaceAlloc 5U
  829. #define JET_IdxInfoLangid 6U
  830. #define JET_IdxInfoCount 7U
  831. /* Info levels for JetGetReferenceInfo and JetGetTableReferenceInfo */
  832. #define JET_ReferenceInfo 0U
  833. #define JET_ReferenceInfoReferencing 1U
  834. #define JET_ReferenceInfoReferenced 2U
  835. #define JET_ReferenceInfoAll 3U
  836. #define JET_ReferenceInfoCursor 4U
  837. /* Info levels for JetGetColumnInfo and JetGetTableColumnInfo */
  838. #define JET_ColInfo 0U
  839. #define JET_ColInfoList 1U
  840. /* CONSIDER: Info level 2 is valid */
  841. #define JET_ColInfoSysTabCursor 3U
  842. #define JET_ColInfoBase 4U
  843. #define JET_ColInfoListCompact 5U
  844. /* Attribute types for query definitions */
  845. #define JET_qoaBeginDef 0
  846. #define JET_qoaOperation 1
  847. #define JET_qoaParameter 2
  848. #define JET_qoaOptions 3
  849. #define JET_qoaDatabase 4
  850. #define JET_qoaInputTable 5
  851. #define JET_qoaOutput 6
  852. #define JET_qoaJoin 7
  853. #define JET_qoaRestriction 8
  854. #define JET_qoaGroup 9
  855. #define JET_qoaGroupRstr 10
  856. #define JET_qoaOrdering 11
  857. #define JET_qoaEndDef 255
  858. #define JET_qoaValidLeast JET_qoaOperation
  859. #define JET_qoaValidMost JET_qoaOrdering
  860. /* Query object options */
  861. #define JET_bitFqoOutputAllCols 0x0001
  862. #define JET_bitFqoRemoveDups 0x0002
  863. #define JET_bitFqoOwnerAccess 0x0004
  864. #define JET_bitFqoDistinctRow 0x0008
  865. #define JET_bitFqoTop 0x0010
  866. #define JET_bitFqoPercent 0x0020
  867. #define JET_bitFqoCorresponding 0x0040 /* JET_qopSetOperation */
  868. /* Query object join type */
  869. #define JET_fjoinInner 1
  870. #define JET_fjoinLeftOuter 2
  871. #define JET_fjoinRightOuter 3
  872. /* Query object operations */
  873. #define JET_qopSelect 1
  874. #define JET_qopSelectInto 2
  875. #define JET_qopInsertSelection 3
  876. #define JET_qopUpdate 4
  877. #define JET_qopDelete 5
  878. #define JET_qopTransform 6
  879. #define JET_qopDDL 7
  880. #define JET_qopSqlPassThrough 8
  881. #define JET_qopSetOperation 9
  882. #define JET_qopSPTBulk 10
  883. #define JET_bitqopSelect 0x0000
  884. #define JET_bitqopTransform 0x0010
  885. #define JET_bitqopDelete 0x0020
  886. #define JET_bitqopUpdate 0x0030
  887. #define JET_bitqopInsertSelection 0x0040
  888. #define JET_bitqopSelectInto 0x0050
  889. #define JET_bitqopDDL 0x0060
  890. #define JET_bitqopSqlPassThrough 0x0070
  891. #define JET_bitqopSetOperation 0x0080
  892. #define JET_bitqopSPTBulk 0x0090
  893. /* Engine Object Types */
  894. #define JET_objtypNil 0
  895. #define JET_objtypTable 1
  896. #define JET_objtypDb 2
  897. #define JET_objtypContainer 3
  898. #define JET_objtypSQLLink 4
  899. #define JET_objtypQuery 5
  900. #define JET_objtypLink 6
  901. #define JET_objtypTemplate 7
  902. #define JET_objtypRelationship 8
  903. /* All types less than JET_objtypClientMin are reserved by JET */
  904. #define JET_objtypClientMin 0x8000
  905. /* Security Constant Values */
  906. #define JET_cchUserNameMax 20
  907. #define JET_cchPasswordMax 14
  908. /* Security Access Masks */
  909. #define JET_acmNoAccess 0x00000000L
  910. #define JET_acmFullAccess 0x000FFFFFL
  911. #define JET_acmSpecificMask 0x0000FFFFL
  912. #define JET_acmSpecific_1 0x00000001L
  913. #define JET_acmSpecific_2 0x00000002L
  914. #define JET_acmSpecific_3 0x00000004L
  915. #define JET_acmSpecific_4 0x00000008L
  916. #define JET_acmSpecific_5 0x00000010L
  917. #define JET_acmSpecific_6 0x00000020L
  918. #define JET_acmSpecific_7 0x00000040L
  919. #define JET_acmSpecific_8 0x00000080L
  920. #define JET_acmSpecific_9 0x00000100L
  921. #define JET_acmSpecific_10 0x00000200L
  922. #define JET_acmSpecific_11 0x00000400L
  923. #define JET_acmSpecific_12 0x00000800L
  924. #define JET_acmSpecific_13 0x00001000L
  925. #define JET_acmSpecific_14 0x00002000L
  926. #define JET_acmSpecific_15 0x00004000L
  927. #define JET_acmSpecific_16 0x00008000L
  928. #define JET_acmStandardMask 0x00FF0000L
  929. #define JET_acmDelete 0x00010000L
  930. #define JET_acmReadControl 0x00020000L
  931. #define JET_acmWriteDac 0x00040000L
  932. #define JET_acmWriteOwner 0x00080000L
  933. #define JET_acmTblCreate (JET_acmSpecific_1)
  934. #define JET_acmTblAccessRcols (JET_acmSpecific_2)
  935. #define JET_acmTblReadDef (JET_acmSpecific_3)
  936. #define JET_acmTblWriteDef (JET_acmSpecific_4)
  937. #define JET_acmTblRetrieveData (JET_acmSpecific_5)
  938. #define JET_acmTblInsertData (JET_acmSpecific_6)
  939. #define JET_acmTblReplaceData (JET_acmSpecific_7)
  940. #define JET_acmTblDeleteData (JET_acmSpecific_8)
  941. #define JET_acmDbCreate (JET_acmSpecific_1)
  942. #define JET_acmDbOpen (JET_acmSpecific_2)
  943. /* Compact Options */
  944. #define JET_bitCompactDontCopyLocale 0x00000004 /* Don't copy locale from source to dest */
  945. #define JET_bitCompactVersion10 0x00000008 /* Destination is version 1.0 format */
  946. #define JET_bitCompactVersion1x 0x00000010 /* Destination is version 1.x format */
  947. #define JET_bitCompactStats 0x00000020 /* Dump off-line compaction stats (only when progress meter also specified) */
  948. /* On-line Compact Options */
  949. #define JET_bitCompactOn 0x00000001 /* enable on-line compaction */
  950. /* Repair Notification Types */
  951. #define JET_rntSelfContained 0
  952. #define JET_rntDeletedIndex 1
  953. #define JET_rntDeletedRec 2
  954. #define JET_rntDeletedLv 3
  955. #define JET_rntTruncated 4
  956. /* Status Notification Processes */
  957. #define JET_snpIndex 0
  958. #define JET_snpQuery 1
  959. #define JET_snpRepair 2
  960. #define JET_snpImex 3
  961. #define JET_snpCompact 4
  962. #define JET_snpFastFind 5
  963. #define JET_snpODBCNotReady 6
  964. #define JET_snpQuerySort 7
  965. #define JET_snpRestore 8
  966. #define JET_snpBackup 9
  967. #define JET_snpUpgrade 10
  968. /* Status Notification Types */
  969. #define JET_sntProgress 0 /* callback for progress */
  970. #define JET_sntMessage 1
  971. #define JET_sntBulkRecords 2 /* callback for # rec for bulk op */
  972. #define JET_sntFail 3 /* callback for failure during progress */
  973. #define JET_sntErrCount 4 /* callback for err count */
  974. #define JET_sntBegin 5 /* callback for beginning of operation */
  975. #define JET_sntComplete 6 /* callback for completion of operation */
  976. #define JET_sntCantRollback 7 /* callback for no rollback */
  977. #define JET_sntRestoreMap 8 /* callback for restore map */
  978. /* Message codes for JET_snpCompact */
  979. #define JET_sncCopyObject 0 /* Starting to copy object */
  980. #define JET_sncCopyFailed 1 /* Copy of this object failed */
  981. #define JET_sncYield 2 /* Client can yield/check for user interrupt */
  982. #define JET_sncTransactionFull 3 /* Client can yield/check for user interrupt */
  983. #define JET_sncAboutToWrap 4 /* Find find is about to wrap */
  984. /* Message codes for JET_snpODBCNotReady */
  985. #define JET_sncODBCNotReady 0 /* Waiting for results from ODBC */
  986. /* Constants for the [ODBC] section of JET.INI */
  987. #define JET_SQLTraceCanonical 0x0001 /* Output ODBC Generic SQL */
  988. /* Constants for the [Debug] section of JET.INI */
  989. /* APITrace */
  990. #define JET_APITraceEnter 0x0001
  991. #define JET_APITraceExit 0x0002
  992. #define JET_APITraceExitError 0x0004
  993. #define JET_APIBreakOnError 0x0008
  994. #define JET_APITraceCount 0x0010
  995. #define JET_APITraceNoIdle 0x0020
  996. #define JET_APITraceParameters 0x0040
  997. /* IdleTrace */
  998. #define JET_IdleTraceCursor 0x0001
  999. #define JET_IdleTraceBuffer 0x0002
  1000. #define JET_IdleTraceFlush 0x0004
  1001. /* AssertAction */
  1002. #define JET_AssertExit 0x0000 /* Exit the application */
  1003. #define JET_AssertBreak 0x0001 /* Break to debugger */
  1004. #define JET_AssertMsgBox 0x0002 /* Display message box */
  1005. #define JET_AssertStop 0x0004 /* Alert and stop */
  1006. /* IOTrace */
  1007. #define JET_IOTraceAlloc 0x0001 /* DB Page Allocation */
  1008. #define JET_IOTraceFree 0x0002 /* DB Page Free */
  1009. #define JET_IOTraceRead 0x0004 /* DB Page Read */
  1010. #define JET_IOTraceWrite 0x0008 /* DB Page Write */
  1011. #define JET_IOTraceError 0x0010 /* DB Page I/O Error */
  1012. /* MemTrace */
  1013. #define JET_MemTraceAlloc 0x0001 /* Memory allocation */
  1014. #define JET_MemTraceRealloc 0x0002 /* Memory reallocation */
  1015. #define JET_MemTraceFree 0x0004 /* Memory free */
  1016. /* RmtTrace */
  1017. #define JET_RmtTraceError 0x0001 /* Remote server error message */
  1018. #define JET_RmtTraceSql 0x0002 /* Remote SQL Prepares & Exec's */
  1019. #define JET_RmtTraceAPI 0x0004 /* Remote ODBC API calls */
  1020. #define JET_RmtTraceODBC 0x0008
  1021. #define JET_RmtSyncODBC 0x0010 /* Turn on ODBC Sync mode */
  1022. /**********************************************************************/
  1023. /*********************** ERROR CODES **************************/
  1024. /**********************************************************************/
  1025. /* SUCCESS */
  1026. #define JET_errSuccess 0 /* Successful Operation */
  1027. /* ERRORS */
  1028. #define JET_wrnNyi -1 /* Function Not Yet Implemented */
  1029. /* SYSTEM errors
  1030. /**/
  1031. #define JET_errRfsFailure -100 /* JET_errRfsFailure */
  1032. #define JET_errRfsNotArmed -101 /* JET_errRfsFailure */
  1033. #define JET_errFileClose -102 /* Could not close DOS file */
  1034. #define JET_errOutOfThreads -103 /* Could not start thread */
  1035. #define JET_errTooManyIO -105 /* System busy due to too many IOs */
  1036. #define JET_errDatabase200Format -106 /* 200 format database */
  1037. #define JET_errDatabase400Format -107 /* 400 format database */
  1038. /* BUFFER MANAGER errors
  1039. /**/
  1040. #define wrnBFNotSynchronous 200 /* Buffer page evicted */
  1041. #define wrnBFPageNotFound 201 /* Page not found */
  1042. #define errBFInUse -202 /* Cannot abandon buffer */
  1043. #define wrnBFNewIO 203 /* Buffer access caused a new IO (cache miss) */
  1044. #define wrnBFCacheMiss 204 /* Buffer access was a cache miss but didn't cause a new IO */
  1045. #define wrnBFNoBufAvailable 205 /* Need to allocate new buffer for read (used in Async IO ) */
  1046. /* DIRECTORY MANAGER errors
  1047. /**/
  1048. #define errPMOutOfPageSpace -300 /* Out of page space */
  1049. #define errPMItagTooBig -301 /* Itag too big */
  1050. #define errPMRecDeleted -302 /* Record deleted */
  1051. #define errPMTagsUsedUp -303 /* Tags used up */
  1052. #define wrnBMConflict 304 /* conflict in BM Clean up */
  1053. #define errDIRNoShortCircuit -305 /* No Short Circuit Avail */
  1054. #define errDIRCannotSplit -306 /* Cannot horizontally split FDP */
  1055. #define errDIRTop -307 /* Cannot go up */
  1056. #define errDIRFDP 308 /* On an FDP Node */
  1057. #define errDIRNotSynchronous -309 /* May have left critical section */
  1058. #define wrnDIREmptyPage 310 /* Moved through empty page */
  1059. #define errSPConflict -311 /* Device extent being extended */
  1060. #define wrnNDFoundLess 312 /* Found Less */
  1061. #define wrnNDFoundGreater 313 /* Found Greater */
  1062. #define errNDOutSonRange -314 /* Son out of range */
  1063. #define errNDOutItemRange -315 /* Item out of range */
  1064. #define errNDGreaterThanAllItems -316 /* Greater than all items */
  1065. #define errNDLastItemNode -317 /* Last node of item list */
  1066. #define errNDFirstItemNode -318 /* First node of item list */
  1067. #define wrnNDDuplicateItem 319 /* Duplicated Item */
  1068. #define errNDNoItem -320 /* Item not there */
  1069. #define JET_wrnRemainingVersions 321 /* Some versions couldn't be cleaned */
  1070. #define JET_wrnPreviousVersion 322 /* Version already existed */
  1071. #define JET_errPageBoundary -323 /* Reached Page Boundary */
  1072. #define JET_errKeyBoundary -324 /* Reached Key Boundary */
  1073. #define errDIRInPageFather -325 /* sridFather in page to free */
  1074. #define errBMMaxKeyInPage -326 /* used by OLC to avoid cleanup of parent pages */
  1075. #define JET_errBadPageLink -327 /* next/previous page link page does not point back to source */
  1076. #define JET_errBadBookmark -328 /* bookmark has no corresponding address in database */
  1077. #define wrnBMCleanNullOp 329 /* BMClean returns this on encountering a page
  1078. /* deleted MaxKeyInPage [but there was no conflict]
  1079. /* RECORD MANAGER errors
  1080. /**/
  1081. #define wrnFLDKeyTooBig 400 /* Key too big (truncated it) */
  1082. #define errFLDTooManySegments -401 /* Too many key segments */
  1083. #define wrnFLDNullKey 402 /* Key is entirely NULL */
  1084. #define wrnFLDOutOfKeys 403 /* No more keys to extract */
  1085. #define wrnFLDNullSeg 404 /* Null segment in key */
  1086. #define wrnRECLongField 405 /* Separated long value */
  1087. #define JET_wrnSeparateLongValue 406 /* Separated long value */
  1088. #define JET_wrnRecordFoundGreater JET_wrnSeekNotEqual
  1089. #define JET_wrnRecordFoundLess JET_wrnSeekNotEqual
  1090. #define JET_errColumnIllegalNull JET_errNullInvalid
  1091. #define wrnFLDNullFirstSeg 407 /* Null first segment in key */
  1092. #define JET_errKeyTooBig -408 /* Key with column truncation still truncated */
  1093. /* LOGGING/RECOVERY errors
  1094. /**/
  1095. #define JET_errInvalidLoggedOperation -500 /* Logged operation cannot be redone */
  1096. #define JET_errLogFileCorrupt -501 /* Log file is corrupt */
  1097. #define errLGNoMoreRecords -502 /* Last log record read */
  1098. #define JET_errNoBackupDirectory -503 /* No backup directory given */
  1099. #define JET_errBackupDirectoryNotEmpty -504 /* The backup directory is not emtpy */
  1100. #define JET_errBackupInProgress -505 /* Backup is active already */
  1101. #define JET_errMissingPreviousLogFile -509 /* Missing the log file for check point */
  1102. #define JET_errLogWriteFail -510 /* Fail when writing to log file */
  1103. #define JET_errBadLogVersion -514 /* Version of log file is not compatible with Jet version */
  1104. #define JET_errInvalidLogSequence -515 /* Timestamp in next log does not match expected */
  1105. #define JET_errLoggingDisabled -516 /* Log is not active */
  1106. #define JET_errLogBufferTooSmall -517 /* Log buffer is too small for recovery */
  1107. #define errLGNotSynchronous -518 /* retry to LGLogRec */
  1108. #define JET_errLogSequenceEnd -519 /* Exceed maximum log file number */
  1109. #define JET_errNoBackup -520 /* No backup in progress */
  1110. #define JET_errInvalidBackupSequence -521 /* Backup call out of sequence */
  1111. #define JET_errBackupNotAllowedYet -523 /* Can not do backup now */
  1112. #define JET_errDeleteBackupFileFail -524 /* Could not delete backup file */
  1113. #define JET_errMakeBackupDirectoryFail -525 /* Could not make backup temp directory */
  1114. #define JET_errInvalidBackup -526 /* Cannot incremental backup when circular logging enabled */
  1115. #define JET_errRecoveredWithErrors -527 /* For repair, restored with errors */
  1116. #define JET_errMissingLogFile -528 /* current log file missing */
  1117. #define JET_errLogDiskFull -529 /* log disk full */
  1118. #define JET_errBadLogSignature -530 /* bad signature for a log file */
  1119. #define JET_errBadDbSignature -531 /* bad signature for a db file */
  1120. #define JET_errBadCheckpointSignature -532 /* bad signature for a checkpoint file */
  1121. #define JET_errCheckpointCorrupt -533 /* checkpoint file not found or corrupt */
  1122. #define JET_errMissingPatchPage -534 /* patch file page not found during recovery */
  1123. #define JET_errDatabaseInconsistent -550 /* database is in inconsistent state */
  1124. #define JET_errConsistentTimeMismatch -551 /* database last consistent time unmatched */
  1125. #define JET_errDatabasePatchFileMismatch -552 /* patch file is not generated from this backup */
  1126. #define JET_errEndingRestoreLogTooLow -553 /* the starting log number too low for the restore */
  1127. #define JET_errStartingRestoreLogTooHigh -554 /* the starting log number too high for the restore */
  1128. #define JET_errGivenLogFileHasBadSignature -555 /* Restore log file has bad signature */
  1129. #define JET_errGivenLogFileIsNotContiguous -556 /* Restore log file is not contiguous */
  1130. #define JET_errMissingRestoreLogFiles -557 /* Some restore log files are missing */
  1131. #define JET_wrnExistingLogFileHasBadSignature 558 /* Existing log file has bad signature */
  1132. #define JET_wrnExistingLogFileIsNotContiguous 559 /* Existing log file is not contiguous */
  1133. #define JET_errMissingFullBackup -560 /* The database miss a previous full backup befor incremental backup */
  1134. #define JET_errBadBackupDatabaseSize -561 /* The backup database size is not in 4k */
  1135. #define JET_errDatabaseAlreadyUpgraded -562 /* Attempted to upgrade a database that is already current */
  1136. #define JET_errTermInProgress -1000 /* Termination in progress */
  1137. #define JET_errFeatureNotAvailable -1001 /* API not supported */
  1138. #define JET_errInvalidName -1002 /* Invalid name */
  1139. #define JET_errInvalidParameter -1003 /* Invalid API parameter */
  1140. #define JET_wrnColumnNull 1004 /* Column is NULL-valued */
  1141. #define JET_wrnBufferTruncated 1006 /* Buffer too small for data */
  1142. #define JET_wrnDatabaseAttached 1007 /* Database is already attached */
  1143. #define JET_errDatabaseFileReadOnly -1008 /* Attach a readonly database file for read/write operations */
  1144. #define JET_wrnSortOverflow 1009 /* Sort does not fit in memory */
  1145. #define JET_errInvalidDatabaseId -1010 /* Invalid database id */
  1146. #define JET_errOutOfMemory -1011 /* Out of Memory */
  1147. #define JET_errOutOfDatabaseSpace -1012 /* Maximum database size reached */
  1148. #define JET_errOutOfCursors -1013 /* Out of table cursors */
  1149. #define JET_errOutOfBuffers -1014 /* Out of database page buffers */
  1150. #define JET_errTooManyIndexes -1015 /* Too many indexes */
  1151. #define JET_errTooManyKeys -1016 /* Too many columns in an index */
  1152. #define JET_errRecordDeleted -1017 /* Record has been deleted */
  1153. #define JET_errReadVerifyFailure -1018 /* Read verification error */
  1154. #define JET_errOutOfFileHandles -1020 /* Out of file handles */
  1155. #define JET_errDiskIO -1022 /* Disk IO error */
  1156. #define JET_errInvalidPath -1023 /* Invalid file path */
  1157. #define JET_errRecordTooBig -1026 /* Record larger than maximum size */
  1158. #define JET_errTooManyOpenDatabases -1027 /* Too many open databases */
  1159. #define JET_errInvalidDatabase -1028 /* Not a database file */
  1160. #define JET_errNotInitialized -1029 /* JetInit not yet called */
  1161. #define JET_errAlreadyInitialized -1030 /* JetInit already called */
  1162. #define JET_errFileAccessDenied -1032 /* Cannot access file */
  1163. #define JET_errQueryNotSupported -1034 /* Query support unavailable */
  1164. #define JET_errSQLLinkNotSupported -1035 /* SQL Link support unavailable */
  1165. #define JET_errBufferTooSmall -1038 /* Buffer is too small */
  1166. #define JET_wrnSeekNotEqual 1039 /* SeekLE or SeekGE didn't find exact match */
  1167. #define JET_errTooManyColumns -1040 /* Too many columns defined */
  1168. #define JET_errContainerNotEmpty -1043 /* Container is not empty */
  1169. #define JET_errInvalidFilename -1044 /* Filename is invalid */
  1170. #define JET_errInvalidBookmark -1045 /* Invalid bookmark */
  1171. #define JET_errColumnInUse -1046 /* Column used in an index */
  1172. #define JET_errInvalidBufferSize -1047 /* Data buffer doesn't match column size */
  1173. #define JET_errColumnNotUpdatable -1048 /* Cannot set column value */
  1174. #define JET_errIndexInUse -1051 /* Index is in use */
  1175. #define JET_errLinkNotSupported -1052 /* Link support unavailable */
  1176. #define JET_errNullKeyDisallowed -1053 /* Null keys are disallowed on index */
  1177. #define JET_errNotInTransaction -1054 /* Operation must be within a transaction */
  1178. #define JET_wrnNoErrorInfo 1055 /* No extended error information */
  1179. #define JET_wrnNoIdleActivity 1058 /* No idle activity occured */
  1180. #define JET_errTooManyActiveUsers -1059 /* Too many active database users */
  1181. #define JET_errInvalidAppend -1060 /* Cannot append long value */
  1182. #define JET_errInvalidCountry -1061 /* Invalid or unknown country code */
  1183. #define JET_errInvalidLanguageId -1062 /* Invalid or unknown language id */
  1184. #define JET_errInvalidCodePage -1063 /* Invalid or unknown code page */
  1185. #define JET_wrnNoWriteLock 1067 /* No write lock at transaction level 0 */
  1186. #define JET_wrnColumnSetNull 1068 /* Column set to NULL-value */
  1187. #define JET_errVersionStoreOutOfMemory -1069 /* lMaxVerPages exceeded (XJET only) */
  1188. #define JET_errCurrencyStackOutOfMemory -1070 /* lCSRPerfFUCB * lMaxCursors exceeded (XJET only) */
  1189. #define JET_errOutOfSessions -1101 /* Out of sessions */
  1190. #define JET_errWriteConflict -1102 /* Write lock failed due to outstanding write lock */
  1191. #define JET_errTransTooDeep -1103 /* Xactions nested too deeply */
  1192. #define JET_errInvalidSesid -1104 /* Invalid session handle */
  1193. #define JET_errSessionWriteConflict -1107 /* Another session has private version of page */
  1194. #define JET_errInTransaction -1108 /* Operation not allowed within a transaction */
  1195. #define JET_errDatabaseDuplicate -1201 /* Database already exists */
  1196. #define JET_errDatabaseInUse -1202 /* Database in use */
  1197. #define JET_errDatabaseNotFound -1203 /* No such database */
  1198. #define JET_errDatabaseInvalidName -1204 /* Invalid database name */
  1199. #define JET_errDatabaseInvalidPages -1205 /* Invalid number of pages */
  1200. #define JET_errDatabaseCorrupted -1206 /* non-db file or corrupted db */
  1201. #define JET_errDatabaseLocked -1207 /* Database exclusively locked */
  1202. #define JET_errCannotDisableVersioning -1208 /* Cannot disable versioning for this database */
  1203. #define JET_wrnTableEmpty 1301 /* Open an empty table */
  1204. #define JET_errTableLocked -1302 /* Table is exclusively locked */
  1205. #define JET_errTableDuplicate -1303 /* Table already exists */
  1206. #define JET_errTableInUse -1304 /* Table is in use, cannot lock */
  1207. #define JET_errObjectNotFound -1305 /* No such table or object */
  1208. #define JET_errDensityInvalid -1307 /* Bad file/index density */
  1209. #define JET_errTableNotEmpty -1308 /* Cannot define clustered index */
  1210. #define JET_errInvalidTableId -1310 /* Invalid table id */
  1211. #define JET_errTooManyOpenTables -1311 /* Cannot open any more tables */
  1212. #define JET_errIllegalOperation -1312 /* Oper. not supported on table */
  1213. #define JET_errObjectDuplicate -1314 /* Table or object name in use */
  1214. #define JET_errInvalidObject -1316 /* object is invalid for operation */
  1215. #define JET_errIndexCantBuild -1401 /* Cannot build clustered index */
  1216. #define JET_errIndexHasPrimary -1402 /* Primary index already defined */
  1217. #define JET_errIndexDuplicate -1403 /* Index is already defined */
  1218. #define JET_errIndexNotFound -1404 /* No such index */
  1219. #define JET_errIndexMustStay -1405 /* Cannot delete clustered index */
  1220. #define JET_errIndexInvalidDef -1406 /* Illegal index definition */
  1221. #define JET_errIndexHasClustered -1408 /* Clustered index already defined */
  1222. #define JET_errInvalidCreateIndex -1409 /* Invali create index description */
  1223. #define JET_errTooManyOpenIndexes -1410 /* Out of index description blocks */
  1224. #define JET_errColumnLong -1501 /* Column value is long */
  1225. #define JET_errColumnNoChunk -1502 /* no such chunk in long value */
  1226. #define JET_errColumnDoesNotFit -1503 /* Field will not fit in record */
  1227. #define JET_errNullInvalid -1504 /* Null not valid */
  1228. #define JET_errColumnIndexed -1505 /* Column indexed, cannot delete */
  1229. #define JET_errColumnTooBig -1506 /* Field length is > maximum */
  1230. #define JET_errColumnNotFound -1507 /* No such column */
  1231. #define JET_errColumnDuplicate -1508 /* Field is already defined */
  1232. #define JET_errColumn2ndSysMaint -1510 /* Second autoinc or version column */
  1233. #define JET_errInvalidColumnType -1511 /* Invalid column data type */
  1234. #define JET_wrnColumnMaxTruncated 1512 /* Max length too big, truncated */
  1235. #define JET_errColumnCannotIndex -1513 /* Cannot index Bit,LongText,LongBinary */
  1236. #define JET_errTaggedNotNULL -1514 /* No non-NULL tagged columns */
  1237. #define JET_errNoCurrentIndex -1515 /* Invalid w/o a current index */
  1238. #define JET_errKeyIsMade -1516 /* The key is completely made */
  1239. #define JET_errBadColumnId -1517 /* Column Id Incorrect */
  1240. #define JET_errBadItagSequence -1518 /* Bad itagSequence for tagged column */
  1241. #define JET_errColumnInRelationship -1519 /* Cannot delete, column participates in relationship */
  1242. #define JET_wrnCopyLongValue 1520 /* Single instance column bursted */
  1243. #define JET_errCannotBeTagged -1521 /* AutoIncrement and Version cannot be tagged */
  1244. #define JET_errRecordNotFound -1601 /* The key was not found */
  1245. #define JET_errRecordNoCopy -1602 /* No working buffer */
  1246. #define JET_errNoCurrentRecord -1603 /* Currency not on a record */
  1247. #define JET_errRecordClusteredChanged -1604 /* Clustered key may not change */
  1248. #define JET_errKeyDuplicate -1605 /* Illegal duplicate key */
  1249. #define JET_errAlreadyPrepared -1607 /* Already copy/clear current */
  1250. #define JET_errKeyNotMade -1608 /* No call to JetMakeKey */
  1251. #define JET_errUpdateNotPrepared -1609 /* No call to JetPrepareUpdate */
  1252. #define JET_wrnDataHasChanged 1610 /* Data has changed */
  1253. #define JET_errDataHasChanged -1611 /* Data has changed, operation aborted */
  1254. #define JET_wrnKeyChanged 1618 /* Moved to new key */
  1255. #define JET_errTooManySorts -1701 /* Too many sort processes */
  1256. #define JET_errInvalidOnSort -1702 /* Invalid operation on Sort */
  1257. #define JET_errTempFileOpenError -1803 /* Temp file could not be opened */
  1258. #define JET_errTooManyAttachedDatabases -1805 /* Too many open databases */
  1259. #define JET_errDiskFull -1808 /* No space left on disk */
  1260. #define JET_errPermissionDenied -1809 /* Permission denied */
  1261. #define JET_errFileNotFound -1811 /* File not found */
  1262. #define JET_wrnFileOpenReadOnly 1813 /* Database file is read only */
  1263. #define JET_errAfterInitialization -1850 /* Cannot Restore after init. */
  1264. #define JET_errLogCorrupted -1852 /* Logs could not be interpreted */
  1265. #define JET_errInvalidOperation -1906 /* invalid operation */
  1266. #define JET_errAccessDenied -1907 /* access denied */
  1267. #define JET_wrnIdleFull 1908 /* ilde registry full */
  1268. /**********************************************************************/
  1269. /*********************** PROTOTYPES **************************/
  1270. /**********************************************************************/
  1271. #if !defined(_JET_NOPROTOTYPES)
  1272. JET_ERR JET_API JetInit(JET_INSTANCE *pinstance);
  1273. JET_ERR JET_API JetTerm(JET_INSTANCE instance);
  1274. JET_ERR JET_API JetTerm2( JET_INSTANCE instance, JET_GRBIT grbit );
  1275. JET_ERR JET_API JetSetSystemParameter(JET_INSTANCE *pinstance, JET_SESID sesid, unsigned long paramid,
  1276. ULONG_PTR lParam, const char *sz);
  1277. JET_ERR JET_API JetGetSystemParameter(JET_INSTANCE instance, JET_SESID sesid, unsigned long paramid,
  1278. ULONG_PTR *plParam, char *sz, unsigned long cbMax);
  1279. #define ctAccessPage 1
  1280. #define ctLatchConflict 2
  1281. #define ctSplitRetry 3
  1282. #define ctNeighborPageScanned 4
  1283. #define ctSplits 5
  1284. JET_ERR JET_API JetResetCounter( JET_SESID sesid, long CounterType );
  1285. JET_ERR JET_API JetGetCounter( JET_SESID sesid, long CounterType, long *plValue );
  1286. JET_ERR JET_API JetBeginSession(JET_INSTANCE instance, JET_SESID *psesid,
  1287. const char *szUserName, const char *szPassword);
  1288. JET_ERR JET_API JetDupSession(JET_SESID sesid, JET_SESID *psesid);
  1289. JET_ERR JET_API JetEndSession(JET_SESID sesid, JET_GRBIT grbit);
  1290. JET_ERR JET_API JetGetVersion(JET_SESID sesid, unsigned long *pwVersion);
  1291. JET_ERR JET_API JetIdle(JET_SESID sesid, JET_GRBIT grbit);
  1292. JET_ERR JET_API JetCreateDatabase(JET_SESID sesid,
  1293. const char *szFilename, const char *szConnect,
  1294. JET_DBID *pdbid, JET_GRBIT grbit);
  1295. JET_ERR JET_API JetAttachDatabase(JET_SESID sesid, const char *szFilename, JET_GRBIT grbit );
  1296. JET_ERR JET_API JetDetachDatabase(JET_SESID sesid, const char *szFilename);
  1297. JET_ERR JET_API JetCreateTable(JET_SESID sesid, JET_DBID dbid,
  1298. const char *szTableName, unsigned long lPages, unsigned long lDensity,
  1299. JET_TABLEID *ptableid);
  1300. JET_ERR JET_API JetCreateTableColumnIndex( JET_SESID sesid, JET_DBID dbid,
  1301. JET_TABLECREATE *ptablecreate );
  1302. JET_ERR JET_API JetDeleteTable(JET_SESID sesid, JET_DBID dbid,
  1303. const char *szTableName);
  1304. JET_ERR JET_API JetGetTableColumnInfo(JET_SESID sesid, JET_TABLEID tableid,
  1305. const char *szColumnName, void *pvResult, unsigned long cbMax,
  1306. unsigned long InfoLevel);
  1307. JET_ERR JET_API JetGetColumnInfo(JET_SESID sesid, JET_DBID dbid,
  1308. const char *szTableName, const char *szColumnName,
  1309. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  1310. JET_ERR JET_API JetAddColumn(JET_SESID sesid, JET_TABLEID tableid,
  1311. const char *szColumn, const JET_COLUMNDEF *pcolumndef,
  1312. const void *pvDefault, unsigned long cbDefault,
  1313. JET_COLUMNID *pcolumnid);
  1314. JET_ERR JET_API JetDeleteColumn(JET_SESID sesid, JET_TABLEID tableid,
  1315. const char *szColumn);
  1316. JET_ERR JET_API JetGetTableIndexInfo(JET_SESID sesid, JET_TABLEID tableid,
  1317. const char *szIndexName, void *pvResult, unsigned long cbResult,
  1318. unsigned long InfoLevel);
  1319. JET_ERR JET_API JetGetTableInfo(JET_SESID sesid, JET_TABLEID tableid,
  1320. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  1321. JET_ERR JET_API JetGetIndexInfo(JET_SESID sesid, JET_DBID dbid,
  1322. const char *szTableName, const char *szIndexName,
  1323. void *pvResult, unsigned long cbResult, unsigned long InfoLevel);
  1324. JET_ERR JET_API JetCreateIndex(JET_SESID sesid, JET_TABLEID tableid,
  1325. const char *szIndexName, JET_GRBIT grbit,
  1326. const char *szKey, unsigned long cbKey, unsigned long lDensity);
  1327. JET_ERR JET_API JetDeleteIndex(JET_SESID sesid, JET_TABLEID tableid,
  1328. const char *szIndexName);
  1329. JET_ERR JET_API JetGetObjectInfo(JET_SESID sesid, JET_DBID dbid,
  1330. JET_OBJTYP objtyp, const char *szContainerName,
  1331. const char *szObjectName, void *pvResult, unsigned long cbMax,
  1332. unsigned long InfoLevel);
  1333. JET_ERR JET_API JetBeginTransaction(JET_SESID sesid);
  1334. JET_ERR JET_API JetCommitTransaction(JET_SESID sesid, JET_GRBIT grbit);
  1335. JET_ERR JET_API JetRollback(JET_SESID sesid, JET_GRBIT grbit);
  1336. JET_ERR JET_API JetGetDatabaseInfo(JET_SESID sesid, JET_DBID dbid,
  1337. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  1338. JET_ERR JET_API JetCloseDatabase(JET_SESID sesid, JET_DBID dbid,
  1339. JET_GRBIT grbit);
  1340. JET_ERR JET_API JetCloseTable(JET_SESID sesid, JET_TABLEID tableid);
  1341. JET_ERR JET_API JetOpenDatabase(JET_SESID sesid, const char *szFilename,
  1342. const char *szConnect, JET_DBID *pdbid, JET_GRBIT grbit);
  1343. JET_ERR JET_API JetOpenTable(JET_SESID sesid, JET_DBID dbid,
  1344. const char *szTableName, const void *pvParameters,
  1345. unsigned long cbParameters, JET_GRBIT grbit, JET_TABLEID *ptableid);
  1346. JET_ERR JET_API JetDelete(JET_SESID sesid, JET_TABLEID tableid);
  1347. JET_ERR JET_API JetUpdate(JET_SESID sesid, JET_TABLEID tableid,
  1348. void *pvBookmark, unsigned long cbBookmark,
  1349. unsigned long *pcbActual);
  1350. JET_ERR JET_API JetRetrieveColumn(JET_SESID sesid, JET_TABLEID tableid,
  1351. JET_COLUMNID columnid, void *pvData, unsigned long cbData,
  1352. unsigned long *pcbActual, JET_GRBIT grbit, JET_RETINFO *pretinfo);
  1353. JET_ERR JET_API JetRetrieveColumns( JET_SESID sesid, JET_TABLEID tableid,
  1354. JET_RETRIEVECOLUMN *pretrievecolumn, unsigned long cretrievecolumn );
  1355. JET_ERR JET_API JetSetColumn(JET_SESID sesid, JET_TABLEID tableid,
  1356. JET_COLUMNID columnid, const void *pvData, unsigned long cbData,
  1357. JET_GRBIT grbit, JET_SETINFO *psetinfo);
  1358. JET_ERR JET_API JetSetColumns(JET_SESID sesid, JET_TABLEID tableid,
  1359. JET_SETCOLUMN *psetcolumn, unsigned long csetcolumn );
  1360. JET_ERR JET_API JetPrepareUpdate(JET_SESID sesid, JET_TABLEID tableid,
  1361. unsigned long prep);
  1362. JET_ERR JET_API JetGetRecordPosition(JET_SESID sesid, JET_TABLEID tableid,
  1363. JET_RECPOS *precpos, unsigned long cbRecpos);
  1364. JET_ERR JET_API JetGotoPosition(JET_SESID sesid, JET_TABLEID tableid,
  1365. JET_RECPOS *precpos );
  1366. JET_ERR JET_API JetGetCursorInfo(JET_SESID sesid, JET_TABLEID tableid,
  1367. void *pvResult, unsigned long cbMax, unsigned long InfoLevel);
  1368. JET_ERR JET_API JetDupCursor(JET_SESID sesid, JET_TABLEID tableid,
  1369. JET_TABLEID *ptableid, JET_GRBIT grbit);
  1370. JET_ERR JET_API JetGetCurrentIndex(JET_SESID sesid, JET_TABLEID tableid,
  1371. char *szIndexName, unsigned long cchIndexName);
  1372. JET_ERR JET_API JetSetCurrentIndex(JET_SESID sesid, JET_TABLEID tableid,
  1373. const char *szIndexName);
  1374. JET_ERR JET_API JetSetCurrentIndex2(JET_SESID sesid, JET_TABLEID tableid,
  1375. const char *szIndexName, JET_GRBIT grbit );
  1376. JET_ERR JET_API JetMove(JET_SESID sesid, JET_TABLEID tableid,
  1377. long cRow, JET_GRBIT grbit);
  1378. JET_ERR JET_API JetMakeKey(JET_SESID sesid, JET_TABLEID tableid,
  1379. const void *pvData, unsigned long cbData, JET_GRBIT grbit);
  1380. JET_ERR JET_API JetSeek(JET_SESID sesid, JET_TABLEID tableid,
  1381. JET_GRBIT grbit);
  1382. JET_ERR JET_API JetGetBookmark(JET_SESID sesid, JET_TABLEID tableid,
  1383. void *pvBookmark, unsigned long cbMax,
  1384. unsigned long *pcbActual);
  1385. JET_ERR JET_API JetCompact(JET_SESID sesid, const char *szDatabaseSrc,
  1386. const char *szDatabaseDest, JET_PFNSTATUS pfnStatus, JET_CONVERT *pconvert,
  1387. JET_GRBIT grbit);
  1388. JET_ERR JET_API JetDBUtilities( JET_DBUTIL *pdbutil );
  1389. JET_ERR JET_API JetGotoBookmark(JET_SESID sesid, JET_TABLEID tableid,
  1390. void *pvBookmark, unsigned long cbBookmark);
  1391. JET_ERR JET_API JetComputeStats(JET_SESID sesid, JET_TABLEID tableid);
  1392. typedef ULONG_PTR JET_VSESID; /* Received from dispatcher */
  1393. struct tagVDBFNDEF;
  1394. typedef ULONG_PTR JET_VDBID; /* Received from dispatcher */
  1395. struct tagVTFNDEF;
  1396. typedef ULONG_PTR JET_VTID; /* Received from dispatcher */
  1397. JET_ERR JET_API JetOpenTempTable(JET_SESID sesid,
  1398. const JET_COLUMNDEF *prgcolumndef, unsigned long ccolumn,
  1399. JET_GRBIT grbit, JET_TABLEID *ptableid,
  1400. JET_COLUMNID *prgcolumnid);
  1401. JET_ERR JET_API JetOpenTempTable2( JET_SESID sesid,
  1402. const JET_COLUMNDEF *prgcolumndef,
  1403. unsigned long ccolumn,
  1404. unsigned long langid,
  1405. JET_GRBIT grbit,
  1406. JET_TABLEID *ptableid,
  1407. JET_COLUMNID *prgcolumnid );
  1408. JET_ERR JET_API JetBackup( const char *szBackupPath, JET_GRBIT grbit, JET_PFNSTATUS pfnStatus );
  1409. JET_ERR JET_API JetRestore(const char *sz, JET_PFNSTATUS pfn );
  1410. JET_ERR JET_API JetRestore2(const char *sz, const char *szDest, JET_PFNSTATUS pfn );
  1411. JET_ERR JET_API JetSetIndexRange(JET_SESID sesid,
  1412. JET_TABLEID tableidSrc, JET_GRBIT grbit);
  1413. JET_ERR JET_API JetIndexRecordCount(JET_SESID sesid,
  1414. JET_TABLEID tableid, unsigned long *pcrec, unsigned long crecMax );
  1415. JET_ERR JET_API JetRetrieveKey(JET_SESID sesid,
  1416. JET_TABLEID tableid, void *pvData, unsigned long cbMax,
  1417. unsigned long *pcbActual, JET_GRBIT grbit );
  1418. JET_ERR JET_API JetBeginExternalBackup( JET_GRBIT grbit );
  1419. JET_ERR JET_API JetGetAttachInfo( void *pv,
  1420. unsigned long cbMax,
  1421. unsigned long *pcbActual );
  1422. JET_ERR JET_API JetOpenFile( const char *szFileName,
  1423. JET_HANDLE *phfFile,
  1424. unsigned long *pulFileSizeLow,
  1425. unsigned long *pulFileSizeHigh );
  1426. JET_ERR JET_API JetReadFile( JET_HANDLE hfFile,
  1427. void *pv,
  1428. unsigned long cb,
  1429. unsigned long *pcb );
  1430. JET_ERR JET_API JetCloseFile( JET_HANDLE hfFile );
  1431. JET_ERR JET_API JetGetLogInfo( void *pv,
  1432. unsigned long cbMax,
  1433. unsigned long *pcbActual );
  1434. JET_ERR JET_API JetTruncateLog( void );
  1435. JET_ERR JET_API JetEndExternalBackup( void );
  1436. JET_ERR JET_API JetExternalRestore( char *szCheckpointFilePath, char *szLogPath, JET_RSTMAP *rgstmap, long crstfilemap, char *szBackupLogPath, long genLow, long genHigh, JET_PFNSTATUS pfn );
  1437. #endif /* _JET_NOPROTOTYPES */
  1438. #pragma pack()
  1439. #ifdef __cplusplus
  1440. }
  1441. #endif
  1442. #endif /* _JET_INCLUDED */
  1443. 
  1444.