VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class / RestoreDatabase Method / RestoreDatabase(Stream,String,String) Method
A readable stream containing a VistaDB Database Backup created by BackupDatabase(Stream).
The filename of the new database file to create. The file should not already exist.
Optional. The password used to encrypt the original database and its backup (if any).


In This Topic
    RestoreDatabase(Stream,String,String) Method
    In This Topic
    Restore a database from a backup file created by BackupDatabase(Stream)
    Syntax
    'Declaration
     
    
    Public Overloads Shared Sub RestoreDatabase( _
       ByVal backupStream As System.IO.Stream, _
       ByVal databaseFileName As System.String, _
       Optional ByVal encryptionPassword As System.String _
    ) 
    'Usage
     
    
    Dim backupStream As System.IO.Stream
    Dim databaseFileName As System.String
    Dim encryptionPassword As System.String
     
    VistaDBConnection.RestoreDatabase(backupStream, databaseFileName, encryptionPassword)
    public static void RestoreDatabase( 
       System.IO.Stream backupStream,
       System.string databaseFileName,
       System.string encryptionPassword
    )

    Parameters

    backupStream
    A readable stream containing a VistaDB Database Backup created by BackupDatabase(Stream).
    databaseFileName
    The filename of the new database file to create. The file should not already exist.
    encryptionPassword
    Optional. The password used to encrypt the original database and its backup (if any).
    Exceptions
    ExceptionDescription
    If the backupStream or databaseFileName is null
    The backup does not appear to be in the VistaDB Backup format, is corrupted, or is from a newer version of VistaDB.
    Inspect the ErrorId for the specific failure.
    Remarks

    Restores a VistaDB Backup stored in backupStream created with BackupDatabase(Stream) into a new database file specified by databaseFileName. If the original database was encrypted, then the encryptionPassword must be specified.

    The databaseFileName file must not already exist.

    The stream must be positioned at the start of the VistaDB backup data. The stream must end at the end of the VistaDB Backup data.

    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