VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class / PackDatabase Method / PackDatabase(String,String,String,Int32,Int32,Boolean,Boolean,OperationCallbackDelegate) Method
File name of the database to pack.
The current encryption Password for the database, or null (Nothing) if not encrypted.
The new encryption Password to use, or null (Nothing) to leave database unencrypted.
New page size. Pass 0 to leave the page size at the current setting.
New locale LocaleID. Pass 0 to leave the LocaleID with it's current setting.
New case sensitivity setting.
True to create a backup copy before packing. The backup file will have the same filename but with .backupCopy appended. If a file by that name already exists it will be overwritten.
VistaDB.DDA.OperationCallbackDelegate method for feedback of pack progress. You may pass null or Nothing if callbacks are not needed.


In This Topic
    PackDatabase(String,String,String,Int32,Int32,Boolean,Boolean,OperationCallbackDelegate) Method
    In This Topic
    Pack a specified database with support for changing database options like encryption key, page size, and culture and making an optional backup and use of callbacks for progress reporting.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Sub PackDatabase( _
       ByVal fileName As System.String, _
       ByVal encryptionPassword As System.String, _
       ByVal newEncryptionPassword As System.String, _
       ByVal newPageSize As System.Integer, _
       ByVal newLCID As System.Integer, _
       ByVal newCaseSensitive As System.Boolean, _
       ByVal backup As System.Boolean, _
       ByVal operationCallbackDelegate As OperationCallbackDelegate _
    ) 
    'Usage
     
    
    Dim fileName As System.String
    Dim encryptionPassword As System.String
    Dim newEncryptionPassword As System.String
    Dim newPageSize As System.Integer
    Dim newLCID As System.Integer
    Dim newCaseSensitive As System.Boolean
    Dim backup As System.Boolean
    Dim operationCallbackDelegate As OperationCallbackDelegate
     
    VistaDBConnection.PackDatabase(fileName, encryptionPassword, newEncryptionPassword, newPageSize, newLCID, newCaseSensitive, backup, operationCallbackDelegate)
    public static void PackDatabase( 
       System.string fileName,
       System.string encryptionPassword,
       System.string newEncryptionPassword,
       System.int newPageSize,
       System.int newLCID,
       System.bool newCaseSensitive,
       System.bool backup,
       OperationCallbackDelegate operationCallbackDelegate
    )

    Parameters

    fileName
    File name of the database to pack.
    encryptionPassword
    The current encryption Password for the database, or null (Nothing) if not encrypted.
    newEncryptionPassword
    The new encryption Password to use, or null (Nothing) to leave database unencrypted.
    newPageSize
    New page size. Pass 0 to leave the page size at the current setting.
    newLCID
    New locale LocaleID. Pass 0 to leave the LocaleID with it's current setting.
    newCaseSensitive
    New case sensitivity setting.
    backup
    True to create a backup copy before packing. The backup file will have the same filename but with .backupCopy appended. If a file by that name already exists it will be overwritten.
    operationCallbackDelegate
    VistaDB.DDA.OperationCallbackDelegate method for feedback of pack progress. You may pass null or Nothing if callbacks are not needed.
    Remarks
    Pack database to recover unused space and re-balance the storage of tables and indexes.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also