MsiViewGetError

[This is preliminary documentation and subject to change.]

The MsiViewGetError function returns the error that occurred in the MsiViewModify function.

MSIDBERROR MsiViewGetError(
  MSIHANDLE hView,            // view handle
  LPTSTR szColumnNameBuffer,  // buffer to hold column name string
  DWORD *pcchBuf              // size of buffer
);
 

Parameters

hView
Handle to the view.
szColumnNameBuffer
Specifies the buffer to hold the column name string. This parameter is NULL if there are no errors or if the size of the buffer is too small.
pcchBuf
Specifies the size of the buffer. This parameter returns the size required for the buffer if an error occurs.

Return Values

This function returns one of the following values.

Error code Error number Meaning
MSIDBERROR_INVALIDARG -3 An argument was invalid.
MSIDBERROR_MOREDATA -2 The buffer was too small to receive data.
MSIDBERROR_FUNCTIONERROR -1 The function failed.
MSIDBERROR_NOERROR 0 The function completed successfully with no errors.
MSIDBERROR_DUPLICATEKEY 1 The new record duplicates primary keys of the existing record in a table.
MSIDBERROR_REQUIRED 2 There are no NULL values allowed, or the column is about to be deleted but is referenced by another row.
MSIDBERROR_BADLINK 3 The corresponding record in a foreign table was not found.
MSIDBERROR_OVERFLOW 4 The data is greater than the maximum value allowed.
MSIDBERROR_UNDERFLOW 5 The data is less than the minimum value allowed.
MSIDBERROR_NOTINSET 6 The data is not a member of the values permitted in the set.
MSIDBERROR_BADVERSION 7 An invalid version string was supplied.
MSIDBERROR_BADCASE 8 The case was invalid. The case must be all uppercase or all lowercase.
MSIDBERROR_BADGUID 9 An invalid GUID was supplied.
MSIDBERROR_BADWILDCARD 10 An invalid wildcard file name was supplied, or the use of wildcards was invalid.
MSIDBERROR_BADIDENTIFIER 11 An invalid identifier was supplied.
MSIDBERROR_BADLANGUAGE 12 Invalid language IDs were supplied.
MSIDBERROR_BADFILENAME 13 An invalid file name was supplied.
MSIDBERROR_BADPATH 14 An invalid path was supplied.
MSIDBERROR_BADCONDITION 15 An invalid conditional statement was supplied.
MSIDBERROR_BADFORMATTED 16 An invalid format string was supplied.
MSIDBERROR_BADTEMPLATE 17 An invalid template string was supplied.
MSIDBERROR_BADDEFAULTDIR 18 An invalid string was supplied in the DefaultDir column of the Directory table.
MSIDBERROR_BADREGPATH 19 An invalid registry path string was supplied.
MSIDBERROR_BADCUSTOMSOURCE 20 An invalid string was supplied in the CustomSource column of the CustomAction table.
MSIDBERROR_BADPROPERTY 21 An invalid property string was supplied.
MSIDBERROR_MISSINGDATA 22 The _Validation table is missing a reference to a column.
MSIDBERROR_BADCATEGORY 23 The category column of the _Validation table for the column is invalid.
MSIDBERROR_BADCABINET 24 An invalid cabinet name was supplied.
MSIDBERROR_BADKEYTABLE 25 The table in the Keytable column of the _Validation table was not found or loaded.
MSIDBERROR_BADMAXMINVALUES 26 The value in the MaxValue column of the _Validation table is less than the value in the MinValue column.
MSIDBERROR_BADSHORTCUT 27 An invalid shortcut target name was supplied.
MSIDBERROR_STRINGOVERFLOW 28 The string is too long for the length specified by the column definition.
MSIDBERROR_BADLOCALIZEATTRIB 29 An invalid localization attribute was supplied. (Primary keys cannot be localized.)

Remarks

You should only call the MsiViewGetError function when MsiViewModify returns ERROR_INVALID_DATA, indicating that the data is invalid. Errors are only recorded for MSIMODIFY_VALIDATE, MSIMODIFY_VALIDATE_NEW, and MSIMODIFY_VALIDATEFIELD.

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, General Database Access Functions