The sp_OA procedure samples use the sp_displayoaerrorinfo procedure. However,the correct procedure is sp_OAGetErrorInfo.
Here is a corrected example:
EXEC @hr = sp_OACreate 'SQLDMO.SQLServer', @object OUT
IF @hr <> 0
EXEC sp_displayoaerrorinfo @object, @hr
NOTE: For SQL Server 6.5 'SQLOLE.SQLServer' needs to be used instead of 'SQLDMO.SQLServer'
The sp_displayoaerrorinfo procedure is not installed by default. If you prefer to use the wrapped stored procedure, the text of this stored procedure can be found in the "OLE Automation Return Codes and Error Information" section of the "Books Online."