The MsiDatabaseApplyTransform function applies a transform to a database.
Syntax
C++UINT MsiDatabaseApplyTransform(
__in MSIHANDLE hDatabase,
__in LPCTSTR szTransformFile,
__in int iErrorConditions
);
Parameters
- hDatabase [in]
-
Handle to the database obtained from MsiOpenDatabase to the transform.
- szTransformFile [in]
-
Specifies the name of the transform file to apply.
- iErrorConditions [in]
-
Error conditions that should be suppressed. This parameter is a bit field that can contain the following bits.
Error condition Meaning - MSITRANSFORM_ERROR_ADDEXISTINGROW
- 0x0001
Adding a row that already exists.
- MSITRANSFORM_ERROR_DELMISSINGROW
- 0x0002
Deleting a row that does not exist.
- MSITRANSFORM_ERROR_ADDEXISTINGTABLE
- 0x0004
Adding a table that already exists.
- MSITRANSFORM_ERROR_DELMISSINGTABLE
- 0x0008
Deleting a table that does not exist.
- MSITRANSFORM_ERROR_UPDATEMISSINGROW
- 0x0010
Updating a row that does not exist.
- MSITRANSFORM_ERROR_CHANGECODEPAGE
- 0x0020
Transform and database code pages do not match and neither has a neutral code page.
- MSITRANSFORM_ERROR_VIEWTRANSFORM
- 0x0100
Create the temporary _TransformView table.
Return Value
The MsiDatabaseApplyTransform function returns one of the following values:
- ERROR_INVALID_HANDLE
-
An invalid or inactive handle was supplied.
- ERROR_INVALID_PARAMETER
-
An invalid parameter was passed to the function.
- ERROR_INSTALL_TRANSFORM_FAILURE
-
The transform could not be applied.
- ERROR_OPEN_FAILED
-
The transform storage file could not be opened.
- ERROR_SUCCESS
-
The function succeeded.
Remarks
The MsiDatabaseApplyTransform function delays transforming tables until it is necessary. Any tables to be added or dropped are processed immediately. However, changes to the existing table are delayed until the table is loaded or the database is committed.
An error occurs if MsiDatabaseApplyTransform is called when tables have already been loaded and saved to storage.
Because the list delimiter for transforms, sources and patches is a semicolon, this character should not be used for filenames or paths.
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 obtain extended error information by using MsiGetLastErrorRecord.
Requirements
Version | Windows 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 |
---|---|
Header | Msiquery.h |
Library | Msi.lib |
DLL | Msi.dll |
Unicode and ANSI names | MsiDatabaseApplyTransformW (Unicode) and MsiDatabaseApplyTransformA (ANSI) |
See Also
Send comments about this topic to Microsoft
Build date: 8/13/2009
© 2009 Microsoft Corporation. All rights reserved.