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.

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