;- Microsoft ESENT.H ; By Thunder93, Posted on 2017-02-22, Updated Last: 2017-02-23 ; Information obtained from the MSDN article "Extensible Storage Engine Reference": ; http://msdn.microsoft.com/en-us/library/gg269245(v=exchg.10).aspx ;- JET Constants ;-> Error Codes - Logging/Recovery #JET_errSuccess = 0 #JET_wrnRemainingVersions = 321 #JET_wrnUniqueKey = 345 #JET_wrnSeparateLongValue = 406 #JET_wrnExistingLogFileHasBadSignature = 558 #JET_wrnExistingLogFileIsNotContiguous = 559 #JET_wrnSkipThisRecord = 564 #JET_wrnTargetInstanceRunning = 578 #JET_wrnDatabaseRepaired = 595 #JET_wrnColumnNull = 1004 #JET_wrnBufferTruncated = 1006 #JET_wrnDatabaseAttached = 1007 #JET_wrnSortOverflow = 1009 #JET_wrnSeekNotEqual = 1039 #JET_wrnRecordFoundGreater = #JET_wrnSeekNotEqual #JET_wrnRecordFoundLess = #JET_wrnSeekNotEqual #JET_wrnNoErrorInfo = 1055 #JET_wrnNoIdleActivity = 1058 #JET_wrnNoWriteLock = 1067 #JET_wrnColumnSetNull = 1068 #JET_wrnTableEmpty = 1301 #JET_wrnTableInUseBySystem = 1327 #JET_wrnCorruptIndexDeleted = 1415 #JET_wrnColumnMaxTruncated = 1512 #JET_wrnCopyLongValue = 1520 #JET_wrnColumnSkipped = 1531 #JET_wrnColumnNotLocal = 1532 #JET_wrnColumnMoreTags = 1533 #JET_wrnColumnTruncated = 1534 #JET_wrnColumnPresent = 1535 #JET_wrnColumnSingleValue = 1536 #JET_wrnColumnDefault = 1537 #JET_wrnDataHasChanged = 1610 #JET_wrnKeyChanged = 1618 #JET_wrnFileOpenReadOnly = 1813 #JET_wrnIdleFull = 1908 #JET_wrnDefragAlreadyRunning = 2000 #JET_wrnDefragNotRunning = 2001 #JET_wrnCallbackNotRegistered = 2100 #JET_errNoCurrentRecord = -1603 ;;;;;;;;;; New ; #JET_errClientRequestToStopJetService = -1329 ; #JET_errInstanceUnavailable = $FFFFFBBE ; #JET_errNotInitialized = -1029 ; #JET_errRestoreInProgress = -506 ; #JET_errSessionSharingViolation = -1910 ; #JET_errTermInProgress = -1000 ;-> JET_CBTYP #JET_cbtypNull = 0 #JET_cbtypFinalize = 1 #JET_cbtypBeforeInsert = 2 #JET_cbtypAfterInsert = 4 #JET_cbtypBeforeReplace = 8 #JET_cbtypAfterReplace = $10 #JET_cbtypBeforeDelete = $20 #JET_cbtypAfterDelete = $40 #JET_cbtypUserDefinedDefaultValue = $80 #JET_cbtypOnlineDefragCompleted = $100 #JET_cbtypFreeCursorLS = $200 #JET_cbtypFreeTableLS = $400 ;-> JET_COLTYP #JET_coltypNil = 0 #JET_coltypBit = 1 ; System.Boolean [Byte] #JET_coltypUnsignedByte = 2 ; System.Byte [Byte] #JET_coltypShort = 3 ; System.Int16, System.UInt16 [Word] #JET_coltypLong = 4 ; System.Int32, System.UInt32 [Long] #JET_coltypCurrency = 5 ; System.Int64 [Quad] #JET_coltypIEEESingle = 6 ; System.Single [Float] #JET_coltypIEEEDouble = 7 ; System.Double [Float] #JET_coltypDateTime = 8 ; System.DateTime [Quad] #JET_coltypBinary = 9 ; [ASCII] #JET_coltypText = 10 ; [ASCII TEXT] #JET_coltypLongBinary = 11 ; WIN64 | [LONG] #JET_coltypLongText = 12 ; WIN64 | [ASCII TEXT, LONG] #JET_coltypSLV = 13 ; WIN64 | Reserved #JET_coltypUnsignedLong = 14 ; WINVER >= 0x0600 | #JET_coltypLongLong = 15 ; WINVER >= 0x0600 | #JET_coltypGUID = 16 ; WINVER >= 0x0600 | #JET_coltypUnsignedShort = 17 ; WINVER >= 0x0600 | #JET_coltypUnsignedLongLong = 18 #JET_coltypMax = 19 ; Maximum Number of Column types ;-> Error Handling Constants #JET_ExceptionNone = 0 #JET_ExceptionMsgBox = 1 ;-> GRBit Constants #JET_bitTableDenyWrite = 1 #JET_bitTableDenyRead = 2 #JET_bitTableReadOnly = 4 #JET_bitTableUpdatable = 8 #JET_bitTablePermitDDL = $10 #JET_bitTableNoCache = $20 #JET_bitTablePreread = $40 #JET_bitTableOpportuneRead = $80 #JET_bitTableSequential = $8000 #JET_bitTableClassMask = $f0000 #JET_bitTableClassNone = 0 #JET_bitTableClass1 = $10000 #JET_bitTableClass2 = $20000 #JET_bitTableClass3 = $30000 #JET_bitTableClass4 = $40000 #JET_bitTableClass5 = $50000 #JET_bitTableClass6 = $60000 #JET_bitTableClass7 = $70000 #JET_bitTableClass8 = $80000 #JET_bitTableClass9 = $90000 #JET_bitTableClass10 = $a0000 #JET_bitTableClass11 = $b0000 #JET_bitTableClass12 = $c0000 #JET_bitTableClass13 = $d0000 #JET_bitTableClass14 = $e0000 #JET_bitTableClass15 = $f0000 ;-> Backup and restore parameters #JET_paramDeleteOutOfRangeLogs = 52 #JET_paramZeroDatabaseDuringBackup = 71 ; WINVER >= 0x0501 | #JET_paramCleanupMismatchedLogFiles = 77 #JET_paramOSSnapshotTimeout = 82 ; WINVER >= 0x0501 | #JET_paramAlternateDatabaseRecoveryPath = 113; WINVER >= 0x0502 | ;-> Callback parameters #JET_paramDisableCallbacks = 65 ; WINVER >= 0x0501 | #JET_paramRuntimeCallback = 73 ; WINVER >= 0x0501 | #JET_paramEnablePersistedCallbacks = 156 ; WINVER >= 0x0600 | ;-> Database parameters #JET_paramDbExtensionSize = 18 #JET_paramPageFragment = 20 #JET_paramEnableOnlineDefrag = 35 #JET_paramCheckFormatWhenOpenFail = 44 #JET_paramEnableIndexChecking = 45 #JET_paramEnableIndexCleanup = 54 ; WINVER >= 0x0502 | #JET_paramDatabasePageSize = 64 #JET_paramRecordUpgradeDirtyLevel = 78 ; WINVER >= 0x0501 | #JET_paramOneDatabasePerSession = 102 #JET_paramWaypointLatency = 153 ; WINVER >= 0x0601 | #JET_paramDefragmentSequentialBTrees = 160 ; WINVER >= 0x0601 | #JET_paramDefragmentSequentialBTreesDensityCheckFrequency = 161 ; WINVER >= 0x0601 | #JET_paramIOThrottlingTimeQuanta = 162 ; WINVER >= 0x0601 | ;-> Database cache parameters #JET_paramBatchIOBufferMax = 22 #JET_paramCacheSizeMax = 23 #JET_paramCheckpointDepthMax = 24 #JET_paramLRUKCorrInterval = 25 #JET_paramLRUKHistoryMax = 26 #JET_paramLRUKPolicy = 27 #JET_paramLRUKTimeout = 28 #JET_paramLRUKTrxCorrInterval = 29 #JET_paramStopFlushThreshold = 32 #JET_paramCacheSize = 41 #JET_paramCacheSizeMin = 60 ;+ WINVER >= 0x0600 #JET_paramEnableViewCache = 127 #JET_paramCheckpointIOMax = 135 #JET_paramTableClass1Name = 137 #JET_paramTableClass2Name = 138 #JET_paramTableClass3Name = 139 #JET_paramTableClass4Name = 140 #JET_paramTableClass5Name = 141 #JET_paramTableClass6Name = 142 #JET_paramTableClass7Name = 143 #JET_paramTableClass8Name = 144 #JET_paramTableClass9Name = 145 #JET_paramTableClass10Name = 146 #JET_paramTableClass11Name = 147 #JET_paramTableClass12Name = 148 #JET_paramTableClass13Name = 149 #JET_paramTableClass14Name = 150 #JET_paramTableClass15Name = 151 ;+- ;-> Error handling parameters #JET_paramErrorToString = 70 #JET_paramExceptionAction = 98 ;-> Event Log Parameters ; https://msdn.microsoft.com/en-us/library/gg294086(v=exchg.10).aspx #JET_paramEventSource = 4 ; This parameter supplies an application specific string that will be added to any event log messages that are emitted by the database engine. #JET_paramEventSourceKey = 49 ; This parameter can be used to control which event log the database engine uses for its event log messages. #JET_paramNoInformationEvent = 50 ; When this parameter is true, informational event log messages that would ordinarily be generated by the database engine will be suppressed. #JET_paramEventLoggingLevel = 51 ; WINVER >= 0x0501 | #JET_paramDeleteOutOfRangeLogs = 52 ; WINVER >= 0x0501 | #JET_paramExceptionAction = 98 #JET_paramEventLogCache = 99 ;-> I/O Parameters #JET_paramOutstandingIOMax = 30 #JET_paramAccessDeniedRetryPeriod = 53 ; WINVER >= 0x0501 | #JET_paramCreatePathIfNotExist = 100 #JET_paramEnableFileCache = 126 ; WINVER >= 0x0600 | #JET_paramIOPriority = 152 #JET_paramMaxCoalesceReadSize = 164 ; WINVER >= 0x0601 | #JET_paramMaxCoalesceWriteSize = 165 ; WINVER >= 0x0601 | #JET_paramMaxCoalesceReadGapSize = 166 ; WINVER >= 0x0601 | #JET_paramMaxCoalesceWriteGapSize = 167 ; WINVER >= 0x0601 | ;-> Index Parameters #JET_paramUnicodeIndexDefault = 72 #JET_paramIndexTuplesLengthMin = 110 #JET_paramIndexTuplesLengthMax = 111 #JET_paramIndexTuplesToIndexMax = 112 #JET_paramIndexTupleIncrement = 132 ; WINVER >= 0x0600 | #JET_paramIndexTupleStart = 133 ; WINVER >= 0x0600 | ;-> Informational Parameters #JET_paramMaxColtyp = 131 ; WINVER >= 0x0600 | #JET_paramKeyMost = 134 ; WINVER >= 0x0600 | #JET_paramLVChunkSizeMost = 163 ; WINVER >= 0x0601 | ;-> Meta Parameters #JET_paramConfiguration = 129 ; WINVER >= 0x0600 | #JET_paramEnableAdvanced = 130 ; WINVER >= 0x0600 | ;-> Resource Parameters ; https://msdn.microsoft.com/en-us/library/gg269201(v=exchg.10).aspx #JET_paramMaxSessions = 5 ; This parameter reserves the requested number of session resources for use by an instance. A session resource directly corresponds to a JET_SESID data type. #JET_paramMaxOpenTables = 6 ; This parameter reserves the requested number of B+ Tree resources for use by an instance. This setting will affect how many tables can be used at the same time. #JET_paramPreferredMaxOpenTables = 7 ; WINVER >= 0x0600 | This parameter attempts to keep the number of B+ Tree resources in use below the specified threshold. #JET_paramMaxCursors = 8 ; This parameter reserves the requested number of cursor resources for use by an instance. A cursor resource directly corresponds to a JET_TABLEID data type. #JET_paramMaxVerPages = 9 ; This parameter reserves the requested number of version store pages for use by an instance. #JET_paramMaxTemporaryTables = 10; This parameter reserves the requested number of temporary table resources for use by an instance. #JET_paramPreferredVerPages = 63; This parameter represents a threshold relative to JET_paramMaxVerPages that controls the discretionary use of version pages by the database engine. #JET_paramGlobalMinVerPages = 81; WINVER >= 0x0501 | This parameter allows applications that operate in multi-instance mode to pre-allocate memory for version pages in a global pool to emulate the older behavior. #JET_paramPageHintCacheSize = 101 ; This parameter controls the size of a special cache used to accelerate the lookup of B+ Tree child page pointers in the database page cache. The size of the cache is in bytes. #JET_paramMaxInstances = 104 ; This parameter controls the maximum number of instances that can be created in a single process. #JET_paramVersionStoreTaskQueueMax = 105 ; WINVER >= 0x0501 | This parameter controls the number of background cleanup work items that can be queued to the database engine thread pool at any one time. #JET_paramDisablePerfmon = 107 ; This parameter can be used to prevent the database engine from publishing data about its performance to Windows. This can be done to reduce the service thread activity of the database engine. #JET_paramCachedClosedTables = 125 ; WINVER >= 0x0600 | This parameter controls the number of B+ Tree resources cached by the instance after the tables they represent have been closed by the application. #JET_paramVerPageSize = 128 ; WINVER >= 0x0600 | This parameter controls the size of the version store pages used by the database engine to hold transactional information. ;-> Temporary Database Parameters ; https://msdn.microsoft.com/en-us/library/gg294140(v=exchg.10).aspx #JET_paramTempPath = 1 ; This parameter indicates the relative or absolute file system path of the folder or file that will contain the temporary database for the instance. #JET_paramPageTempDBMin = 19 ; This parameter controls the initial size of the temporary database. The size is in database pages. A size of zero indicates that the default size of an ordinary database should be used. #JET_paramEnableTempTableVersioning = 46 ; This parameter controls the use of transactions in temporary tables. When this parameter is false, temporary tables will be faster but it will not be possible to rollback any updates made in a transaction. ;-> Transaction Log Parameters ; https://msdn.microsoft.com/en-us/library/gg269235(v=exchg.10).aspx #JET_paramSystemPath = 0 ; This parameter indicates the relative or absolute file system path of the folder that will contain the checkpoint file for the instance. #JET_paramLogFilePath = 2 ; This parameter indicates the relative or absolute file system path of the folder that will contain the transaction logs for the instance. #JET_paramBaseName = 3 ; This parameter sets the three letter prefix used for many of the files used by the database engine. #JET_paramLogFileSize = 11 ; This parameter will configure the size of the transaction log files. Each transaction log file is a fixed size. The size is equal to the setting of this system parameter in units of 1024 bytes. #JET_paramLogBuffers = 12 ; This parameter will configure the amount of memory used to cache log records before they are written to the transaction log file. #JET_paramWaitLogFlush = 13 ; This parameter attempts To optimize the flush of the log buffer caused by a durable commit by waiting For a specified time period prior To forcing a flush To occur in the hope that another transaction will share the flush. #JET_paramLogCheckpointPeriod = 14 ; This parameter configures the database engine to take a checkpoint when the specified number of log file sectors has been generated #JET_paramLogWaitingUserMax = 15 ; This parameter attempts to optimize the flush of the log buffer caused by a durable commit by waiting for a specified number of sessions to wait for a durable commit prior to forcing a flush to occur in the hope that another transaction will share the flush. #JET_paramCommitDefault = 16 ; This parameter controls the default action taken when the outermost transaction is committed on a session. #JET_paramCircularLog = 17 ; This parameter configures how transaction log files are managed by the database engine. #JET_paramRecovery = 34 ; This parameter is the master switch that controls crash recovery for an instance. #JET_paramIgnoreLogVersion = 47 ; If this parameter is true then the database engine will not validate the transaction log file version number during JetInit. #JET_paramDeleteOldLogs = 48 ; When this parameter is true and the transaction log files pointed to by the log file path (JET_paramLogFilePath) are all of an obsolete version then those transaction log files will be automatically deleted. #JET_paramLogFileCreateAsynch = 69 ; WINVER >= 0x0501 | When this parameter is set to true, the database engine will create the next transaction log file as the current transaction log file is consumed. #JET_paramLegacyFileNames = 136 ; WINVER >= 0x0600 | This parameter provides backwards compatibility with the file naming conventions of earlier releases of the database engine. ;-> JetGetTableColumnInfo Paramaters #JET_ColInfo = 0 #JET_ColInfoList = 1 #JET_ColInfoSysTabCursor = 3 #JET_ColInfoBase = 4 #JET_ColInfoListCompact = 5 #JET_ColInfoByColid = 6 ; WINVER >= 0x0501 | #JET_ColInfoListSortColumnid = 7 ; WINVER >= 0x0501 | #JET_ColInfoBaseByColid = 8 ; WINVER >= 0x0600 | #JET_ColInfoGrbitSortByColumnid = $20000000 ; WINVER >= 0x0600 | #JET_ColInfoGrbitMinimalInfo = $40000000 ; WINVER >= 0x0600 | #JET_ColInfoGrbitNonDerivedColumnsOnly = $80000000 ; WINVER >= 0x0600 | #JET_bitDbReadOnly = 1 #JET_bitDbExclusive = 2 #JET_bitDbDeleteCorruptIndexes = $10 #JET_bitDbDeleteUnicodeIndexes = $400 ; WINVER >= 0x502 | #JET_bitDbUpgrade = $200 ; WINVER >= 0x501 | #JET_bitDbEnableBackgroundMaintenance = $800 ; WINVER >= 0x0601 | #JET_bitDbPurgeCacheOnAttach = $1000 ; WINVER >= 0x0602 | ;- JET_Move Paramaters #JET_MoveFirst = $80000000 #JET_MovePrevious = -1 #JET_MoveNext = 1 #JET_MoveLast = $7fffffff ;-> Maximum Settings Constants #JET_BASE_NAME_LENGTH = 3 #JET_MAX_COMPUTERNAME_LENGTH = 15 #JET_cbBookmarkMost = 256 #JET_cbBookmarkMostMost = 2000 ; WINVER >= 0x0601 | #JET_cbNameMost = 64 #JET_cbFullNameMost = 255 #JET_cbColumnLVPageOverhead = 82 #JET_cbColumnMost = 255 #JET_cbLVDefaultValueMost = 255 #JET_cbKeyMost = 255 #JET_cbKeyMostMost = 200 ; WINVER >= 0x0601 | #JET_cbKeyMost2KBytePage = 500 ; WINVER >= 0x0600 | #JET_cbKeyMost4KBytePage = 1000 ; WINVER >= 0x0600 | #JET_cbKeyMost8KBytePage = 2000 ; WINVER >= 0x0600 | #JET_cbKeyMostMin = 255 ; WINVER >= 0x0600 | #JET_ccolKeyMost = 12 ; WINVER >= 0x0600 | #JET_cbLimitKeyMost = 256 #JET_cbPrimaryKeyMost = 255 #JET_cbSecondaryKeyMost = 255 ; #JET_ccolMost = $7ffe ; WINVER == 0x500 | #JET_ccolMost = $fee0 ; WINVER >= 0x501 | #JET_ccolFixedMost = $7f #JET_ccolVarMost = $80 #JET_ccolTaggedMost = #JET_ccolMost - $ff ; 64993 #JET_DbInfoFilename = 0 #JET_DbInfoConnect = 1 #JET_DbInfoCountry = 2 #JET_DbInfoLCID = 3 #JET_DbInfoLangid = 3 #JET_DbInfoCp = 4 #JET_DbInfoCollate = 5 #JET_DbInfoOptions = 6 #JET_DbInfoTransactions = 7 #JET_DbInfoVersion = 8 #JET_DbInfoIsam = 9 #JET_DbInfoFilesize = 10 #JET_DbInfoSpaceOwned = 11 #JET_DbInfoSpaceAvailable = 12 #JET_DbInfoUpgrade = 13 #JET_DbInfoMisc = 14 #JET_DbInfoDBInUse = 15 #JET_DbInfoPageSize = 17 #JET_DbInfoFileType = 19 #JET_DbInfoFilesizeOnDisk = 21 #JET_paramEnableDBScanInRecovery = 169 ; WINVER >= 0x0601 | #JET_paramDbScanThrottle = 170 ; WINVER >= 0x0601 | #JET_paramDbScanIntervalMinSec = 171 ; WINVER >= 0x0601 | #JET_paramDbScanIntervalMaxSec = 172 ; WINVER >= 0x0601 | #JET_paramCachePriority = 177 ; WINVER >= 0x0602 | #JET_paramMaxTransactionSize = 178 ; WINVER >= 0x0602 | #JET_paramPrereadIOMax = 179 ; WINVER >= 0x0602 | #JET_paramEnableDBScanSerialization = 180 ; WINVER >= 0x0602 | #JET_paramHungIOThreshold = 181 ; WINVER >= 0x0602 | #JET_paramHungIOActions = 182 ; WINVER >= 0x0602 | #JET_paramMinDataForXpress = 183 ; WINVER >= 0x0602 | #JET_paramEnableShrinkDatabase = 184 ; WINVER >= 0x0603 | #JET_paramProcessFriendlyName = 186 ; WINVER >= 0x0602 | #JET_paramDurableCommitCallback = 187 ; WINVER >= 0x0602 | #JET_paramEnableSqm = 188 ; WINVER >= 0x0603 | #JET_paramConfigStoreSpec = 189 ; WINVER >= 0x0a00 | #JET_paramMaxValueInvalid = 193 ; WINVER >= 0x0a00 | #JET_sesparamCommitDefault = 4097; WINVER >= 0x0a00 | #JET_sesparamTransactionLevel = 4099; WINVER >= 0x0a00 | #JET_sesparamOperationContext = 4100; WINVER >= 0x0a00 | #JET_sesparamCorrelationID = 4101; WINVER >= 0x0a00 | #JET_sesparamMaxValueInvalid = 4102; WINVER >= 0x0a00 | ; Info levels for JetGetIndexInfo and JetGetTableIndexInfo #JET_IdxInfo = 0 #JET_IdxInfoCount = 7 ;---- #BUF_SIZE = 8192 ;- JET Structures ;-> JET_UNICODEINDEX Structure JET_UNICODEINDEX Align #PB_Structure_AlignC lcid.l dwMapFlags.l EndStructure Structure JET_RETRIEVECOLUMN Align #PB_Structure_AlignC columnid.l *pvData cbData.l cbActual.l grbit.l ibLongValue.l itagSequence.l columnidNextTagged.l err.l EndStructure ;-> JET_COLUMNLIST Structure JET_COLUMNLIST Align #PB_Structure_AlignC cbStruct.l tableid.i cRecord.l columnidPresentationOrder.l columnidcolumnname.l columnidcolumnid.l columnidcoltyp.l columnidCountry.l columnidLangid.l columnidCp.l columnidCollate.l columnidcbMax.l columnidgrbit.l columnidDefault.l columnidBaseTableName.l columnidBaseColumnName.l columnidDefinitionName.l EndStructure ;-> JET_INDEXID Structure JET_INDEXID cbStruct.b rgbIndexId.c[SizeOf(INTEGER)+SizeOf(LONG)+SizeOf(LONG)] EndStructure ;-> JET_RETINFO Structure JET_RETINFO Align #PB_Structure_AlignC cbStruct.l ibLongValue.l itagSequence.l columnidNextTagged.l EndStructure Structure JET_SETINFO Align #PB_Structure_AlignC cbStruct.l ibLongValue.l itagSequence.l EndStructure Structure JET_COLUMNDEF Align #PB_Structure_AlignC cbStruct.l columnid.l coltyp.l wCountry.w langid.w cp.w wCollate.w cbMax.l grbit.l EndStructure Structure JET_INDEXLIST Align #PB_Structure_AlignC cbStruct.l tableid.i cRecord.l columnidindexname.l columnidgrbitIndex.l columnidcKey.l columnidcEntry.l columnidcPage.l columnidcColumn.l columnidiColumn.l columnidcolumnid.l columnidcoltyp.l columnidCountry.l columnidLangid.l columnidCp.l columnidCollate.l columnidgrbitColumn.l columnidcolumnname.l columnidLCMapFlags.l EndStructure ;- JET API Prototypes Prototype JetAttachDatabase(*sesid, szFilename.s, grbit.l) Prototype JetBeginSession(*pinstance, *psesid, szUserName.s, szPassword.s) Prototype JetBeginTransaction(*sesid) Prototype JetCloseDatabase(*sesid, dbid.l, grbit.l) Prototype JetCloseTable(*sesid, *tableid) Prototype JetCommitTransaction(*sesid, grbit.l) Prototype JetCreateInstance(*pinstance, szInstanceName.s) Prototype JetSetCurrentIndex(*sesid, *tableid, szIndexName.s) Prototype JetGetCurrentIndex(*sesid, *tableid, szIndexName, cchIndexName.l) Prototype JetDelete(*sesid, *tableid) Prototype JetDetachDatabase(*sesid, szFilename.s) Prototype JetEndSession(*sesid, grbit.l) Prototype JetGetColumnInfo(*sesid, dbid.l, szTableName.s, szColumnName.s, *pvResult, cbMax.l, InfoLevel.l) Prototype JetGetDatabaseFileInfo(szDatabaseName.s, *pvResult, cbMax.l, InfoLevel.l) Prototype JetGetIndexInfo(*sesid, *dbid, szTableName.s, szIndexName.s, *pvResult, cbResult.l, InfoLevel.l) Prototype JetGetSystemParameter(*pinstance, *sesid, paramid.l, plParam.l, *szParam, cbMax.l) Prototype JetGetTableColumnInfo(*sesid, *tableid, szColumnName.s, *pvResult, cbMax.l, InfoLevel.l) Prototype JetGetTableIndexInfo(*sesid, *tableid, szIndexName.s, *pvResult, cbResult.l, InfoLevel.l) Prototype JetInit(*pinstance) Prototype JetMove(*sesid, *tableid, cRow, grbit.l) Prototype JetOpenDatabase(*sesid, szFilename.s, szConnect.s, pdbid.l, grpit.l) Prototype JetOpenTable(*sesid, dbid.l, szTableName.s, pvParameters, cbParameters, grbit.l, *ptableid) Prototype JetPrepareUpdate(*sesid, *tableid, prep.l) Prototype JetRetrieveColumn(*sesid, *tableid, columnid.l, *pvData, cbData.l, pcbActual.l, grbit.l, pretinfo.l) Prototype JetRetrieveColumns(*sesid, *tableid, *pretrievecolumn, cretrievecolumn.l) Prototype JetSetColumn(*sesid, *tableid, columnid.l, *pvData, cbData.l, grbit.l, psetinfo.l) Prototype JetSetSystemParameter(*pinstance, *sesid, paramid.l, lParam.l, szParam.s) Prototype JetTerm(*pinstance) Prototype JetUpdate(*sesid, *tableid, *pvBookmark, cbBookmark.l, *pcbActual) ;- Procedures ; Initialize Jet Prototypes Procedure.b ESENT_Init() Shared hESENT, fExt.s Protected Retr.b CompilerIf #PB_Compiler_Unicode : fExt = "W" : CompilerElse : fExt = "A" : CompilerEndIf hESENT = OpenLibrary(#PB_Any, "esent.dll") If hESENT <> 0 Global JetAttachDatabase.JetAttachDatabase = GetFunction(hESENT, "JetAttachDatabase"+fExt) Global JetBeginSession.JetBeginSession = GetFunction(hESENT, "JetBeginSession"+fExt) Global JetBeginTransaction.JetBeginTransaction = GetFunction(hESENT, "JetBeginTransaction") Global JetCloseDatabase.JetCloseDatabase = GetFunction(hESENT, "JetCloseDatabase") Global JetCloseTable.JetCloseTable = GetFunction(hESENT, "JetCloseTable") Global JetCommitTransaction.JetCommitTransaction = GetFunction(hESENT, "JetCommitTransaction") Global JetCreateInstance.JetCreateInstance = GetFunction(hESENT, "JetCreateInstance"+fExt) Global JetSetCurrentIndex.JetSetCurrentIndex = GetFunction(hESENT, "JetSetCurrentIndex"+fExt) Global JetGetCurrentIndex.JetGetCurrentIndex = GetFunction(hESENT, "JetGetCurrentIndex"+fExt) Global JetDelete.JetDelete = GetFunction(hESENT, "JetDelete") Global JetDetachDatabase.JetDetachDatabase = GetFunction(hESENT, "JetDetachDatabase"+fExt) Global JetEndSession.JetEndSession = GetFunction(hESENT, "JetEndSession") Global JetGetColumnInfo.JetGetColumnInfo = GetFunction(hESENT, "JetGetColumnInfo"+fExt) Global JetGetDatabaseFileInfo.JetGetDatabaseFileInfo = GetFunction(hESENT, "JetGetDatabaseFileInfo"+fExt) Global JetGetIndexInfo.JetGetIndexInfo = GetFunction(hESENT, "JetGetIndexInfo"+fExt) Global JetGetSystemParameter.JetGetSystemParameter = GetFunction(hESENT, "JetGetSystemParameter"+fExt) Global JetGetTableColumnInfo.JetGetTableColumnInfo = GetFunction(hESENT, "JetGetTableColumnInfo"+fExt) Global JetGetTableIndexInfo.JetGetTableIndexInfo = GetFunction(hESENT, "JetGetTableIndexInfo"+fExt) Global JetInit.JetInit = GetFunction(hESENT, "JetInit") Global JetOpenDatabase.JetOpenDatabase = GetFunction(hESENT, "JetOpenDatabase"+fExt) Global JetOpenTable.JetOpenTable = GetFunction(hESENT, "JetOpenTable"+fExt) Global JetMove.JetMove = GetFunction(hESENT, "JetMove") Global JetPrepareUpdate.JetPrepareUpdate = GetFunction(hESENT, "JetPrepareUpdate"+fExt) Global JetRetrieveColumn.JetRetrieveColumn = GetFunction(hESENT, "JetRetrieveColumn") Global JetRetrieveColumns.JetRetrieveColumns = GetFunction(hESENT, "JetRetrieveColumns") Global JetSetColumn.JetSetColumn = GetFunction(hESENT, "JetSetColumn") Global JetSetSystemParameter.JetSetSystemParameter = GetFunction(hESENT, "JetSetSystemParameter"+fExt) Global JetTerm.JetTerm = GetFunction(hESENT, "JetTerm") Global JetUpdate.JetUpdate = GetFunction(hESENT, "JetUpdate") Retr = 1 EndIf ProcedureReturn Retr EndProcedure ; DeInitialize Jet Prototypes Procedure.b ESENT_End() Shared hESENT CloseLibrary(hESENT) EndProcedure ; Convert a JET_ERR code into a text message. Procedure.s JetErrorMessage(Error_code.l) Protected Msg.s, Ret.l Msg = Space(256) Ret = JetGetSystemParameter(0, 0, #JET_paramErrorToString, @Error_code, @Msg, 256) If Ret <> 0 Debug "Can't get error message for code " + error_code EndIf ProcedureReturn "( "+Str(Error_Code) +"): "+ msg EndProcedure ; IDE Options = PureBasic 5.44 LTS (Windows - x64) ; CursorPosition = 53 ; FirstLine = 45 ; Folding = - ; EnableUnicode ; EnableXP ; EnablePurifier