Well, I managed to convert my test form from using a table to using an SQL select on two tables. I originally used "add from data environment" , which created the code below (except that I now have commented out the self.add... lines, and added the usersql)
This works like a charm.
However, I'm a bit confused as to the meaning of the "DataSource" property. I "assumed" that it was the name given to the result of the SQL select (the cursor name), so I changed it from "membertable" which is the name of the actual SQL table to "members", then changed the fields on the form to use "members" rather than "membertable".
Doesn't work.I get an error message "table membership.members does not exist"
What am I missing? What bizobj properties are needed with UserSQL?
def createBizobjs(self): class MembertableBizobj(dabo.biz.dBizobj): def afterInit(self): self.DataSource = "membertable" self.KeyField = "membernum" # self.addFrom("membertable") # self.addField("phone") # self.addField("surname") # self.addField("name") # self.addField("membernum") self.UserSQL = """ select membertable.membernum,membertable.surname, membertable.name,membertable.phone, membercategory.category from membertable inner join membercategory on membertable.categoryid = membercategory.id where membernum=126"""
Larry Bradley Orleans (Ottawa), Ontario, CANADA
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
©2007 Larry Bradley |