Last modified: March 09, 2015
Applies to: Windows | Windows Server
The JetGrowDatabase function extends the size of a database that is currently open.
JET_ERR JET_API JetGrowDatabase( __in JET_SESID sesid, __in JET_DBID dbid, __in unsigned long cpg, __in unsigned long* pcpgReal );
The database session context to use for the API call.
The database that will be extended.
The desired size of the database, in pages.
Pointer to a number that receives the size of the database, in pages, after the API call. If the API call fails, the contents of pcpgReal are undefined.
This function returns the JET_ERR datatype with one of the following return codes. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.
The operation completed successfully.
There is insufficient free space on the volume to perform the grow operation.
If JetGrowDatabase is called prior to inserting large amounts of data, the database file will be grown in one operation. This will reduce the likelihood of the database file becoming fragmented at the file system level, and also reduce the number of times the database file has to be grown. Growing the database file once can be faster than growing it several times.
Only growing the file is currently supported. To shrink a file, use the defragmentation feature of the esentutl.exe utility program.
To set the size of a database that is not opened, see JetSetDatabaseSize.
The file size might not match the number of pages that are returned in pcpgReal. There are two additional reserved pages that might not be counted in pcpgReal.
Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Declared in Esent.h.