You can use a subroutine like the following to display errors:
sub Error (Number, Message)
Wscript.echo "Error #" & Number & " (0x" & Hex(Number) & ") received " & Message
end sub
Then you can call this subroutine whenever an SDK routine returns a non-zero value, as in the following example:
set SearchAdmin = CreateObject("Search.SearchAdmin.1")
if Err.Number <> 0 then
Error Err.Number, "creating SearchAdmin object"
Wscript.quit
end if