dataaccess: Log database query errors.