MsiDatabaseApplyTransformA function (msiquery.h)

The MsiDatabaseApplyTransform function applies a transform to a database.

Syntax

UINT MsiDatabaseApplyTransformA(
  [in] MSIHANDLE hDatabase,
  [in] LPCSTR    szTransformFile,
  [in] int       iErrorConditions
);

Parameters

[in] hDatabase

Handle to the database obtained from MsiOpenDatabase to the transform.

[in] szTransformFile

Specifies the name of the transform file to apply.

[in] iErrorConditions

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:

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.

Note

The msiquery.h header defines MsiDatabaseApplyTransform as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Installer 5.0 on Windows Server 2012, Windows 8, 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 or Windows XP
Target Platform Windows
Header msiquery.h
Library Msi.lib
DLL Msi.dll

See also

Database Management Functions

Database Transforms