LocalDBFormatMessage Function

Returns the localized textual description for the specified SQL Server Express LocalDB error.

Header file: sqlncli.h

Syntax

HRESULT LocalDBFormatMessage(
           HRESULT hrLocalDB,
           DWORD dwFlags, 
           DWORD dwLanguageId, 
           LPWSTR wszMessage, 
           LPDWORD lpcchMessage 
);

Parameters

  • hrLocalDB
    [Input] The LocalDB error code.

  • dwFlags
    [Input] The flags specifying the behavior of this function.

    Available flags:

    • LOCALDB_TRUNCATE_ERR_MESSAGE
      If the input buffer is too short, the error message will be truncated to fit the buffer.
  • dwLanguageId
    [Input] The language desired (LANGID) or 0, in which case the Win32 FormatMessage language order is used.

  • wszMessage
    [Output] The buffer to store the LocalDB error message.

  • lpcchMessage
    [Input/Output] On input contains the size of the wszMessage buffer in characters. On output, if the given buffer size is too small, contains the buffer size required in characters, including any trailing nulls. If the function succeeds, contains the number of characters in the message, excluding any trailing nulls.

Returns

Remarks

For a code sample that uses LocalDB API, see SQL Server Express LocalDB Reference.

See Also

Concepts

SQL Server Express LocalDB Header and Version Information