MsiDatabaseGenerateTransform

[This is preliminary documentation and subject to change.]

The MsiDatabaseGenerateTransform function generates a transform file of differences between two databases. A transform is a way of recording changes to a database without altering the original database.

UINT MsiDatabaseGenerateTransform(
  MSIHANDLE hDatabase,          // database handle
  MSIHANDLE hDatabaseReference, // base database to reference changes
  LPCTSTR szTransformFile,      // name of generated transform file
  int iReserved1,               // reserved argument, not used
  int iReserved2                // reserved argument, not used
);
 

Parameters

hDatabase
Handle to the database that includes the changes.
hDatabaseReference
Handle to the database that does not include the changes.
szTransformFile
The name of the generated transform file. This is optional.
iReserved1
This is a reserved argument and is not used.
iReserved2
This is a reserved argument and is not used.

Return Values

ERROR_NO_DATA
The two databases are identical.
ERROR_CREATE_FAILED
The storage for the transform file could not be created.
ERROR_INSTALL_TRANSFORM_FAILURE
The transform could not be generated.
ERROR_INVALID_HANDLE
An invalid or inactive handle was supplied.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_SUCCESS
The function succeeded.
NOERROR
If szTransformFile is NULL, then this is returned if differences are found.

Remarks

To generate a difference file between two databases, use the MsiDatabaseGenerateTransform function. A transform contains information regarding insertion and deletion of columns and rows. The validation flags are stored in the summary information stream of the transform file.

For tables that exist in both databases, the only difference between the two schemas that is allowed is the addition of columns to the end of the reference table. You cannot add primary key columns to a table or change the order or names or column definitions of the existing columns as defined in the base table. In other words, if neither table contains data and columns are removed from the reference table, the resulting table is identical to the base table.

Since the list delimiter for transforms, sources and patches is a semicolon, this character should not be used for these filenames or paths.

This function does not generate a Summary Information stream. Use MsiCreateTransformSummaryInfo to create the stream for an existing transform.

If szTransformFile is NULL, you can test whether two databases are identical without creating a transform. If the databases are identical, ERROR_NO_DATA is returned, NOERROR is returned if differences are found.

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msiquery.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Database Access Reference, Database Management Functions