On Mar 29, 2013, at 8:30 PM, Aleq <[email protected]> wrote:
> Using bizobj seems to be more reliable to me, but
> there is one problem with addWhere SYNTAX. I try to use variable
> substitution in biz.addWhere( ) like:
> y=self.Form.dYer.Value #value from dTextBox
> I tried
> biz.addWhere("yr=?", (y,) )
> biz.addWhere("yr=%y")
> biz.addWhere("yr = 'y' ")
> but no luck so far.
You don't add the parameters in the addWhere call; you define the WHERE
clause with addWhere(), and the parameters with setParams(). In your example,
you'd write:
biz.addWhere("yr = %s")
biz.setParams(y)
biz.requery()
Note that if you are using SQLite as your database, the syntax for
addWhere is slightly different:
biz.addWhere("yr = ?")
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]