result code handling

correct the result code handling in EXEC
don't switch on extended result codes when opening a database