MsiDatabaseExport Function

Windows Installer

MsiDatabaseExport Function

The MsiDatabaseExport function exports a Microsoft Installer table from an open database to a Text Archive File.

Syntax

C++UINT MsiDatabaseExport(
  __in  MSIHANDLE hDatabase,
  __in  LPCTSTR szTableName,
  __in  LPCTSTR szFolderPath,
  __in  LPCTSTR szFileName
);

Parameters

hDatabase [in]

The handle to a database from MsiOpenDatabase.

szTableName [in]

The name of the table to export.

szFolderPath [in]

The name of the folder that contains archive files.

szFileName [in]

The name of the exported table archive file.

Return Value

The MsiDatabaseExport function returns one of the following values:

Return code Description
ERROR_BAD_PATHNAME

An invalid path is passed to the function.

ERROR_FUNCTION_FAILED

The function fails.

ERROR_INVALID_HANDLE

An invalid or inactive handle is supplied.

ERROR_INVALID_PARAMETER

An invalid parameter is passed to the function.

ERROR_SUCCESS

The function succeeds.

 

Remarks

If a table contains streams, MsiDatabaseExport exports each stream to a separate file.

For more information, see MsiDatabaseImport.

This function cannot be called from custom actions. A call to this function from a custom action causes the function to fail.

If the function fails, you can get extended error information by using MsiGetLastErrorRecord.

Requirements

VersionWindows Installer 5.0 on Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003, Windows XP, and Windows 2000
HeaderMsiquery.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiDatabaseExportW (Unicode) and MsiDatabaseExportA (ANSI)

See Also

Database Management Functions
Text Archive Files

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.