I'm having trouble handling a no record found condition from a requery.

I have the following code in a in a form, which gets called when I click in 
a button:

def Test(self):
         membernum = self.MemberNum
         self.bo.setParams(membernum)
         try:
                 self.bo.requery()
         except NoRecordsException:
                 dabo.ui.exclaim("Not found")

         dabo.ui.info(self.bo.Record.surname)


What I'm trying to do is catch the case where the query failed to return 
any results. "bo" is the bizobject.

I've tried a gaggle of things in the "except" clause, such as

except dException.NoRecordsException:

except self.bo.dException.NoRecordsException:

I always get this:

   File "c:\dabo\dabo\db\dCursorMixin.py", line 703, in getFieldVal
     raise dException.NoRecordsException, _("No records in the data set.")
NoRecordsException: No records in the data set.

Larry Bradley
Orleans (Ottawa), Ontario, CANADA 

--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to