Trouble with SQL and Entry box

Tim Roberts timr at probo.com
Sat Aug 4 19:05:36 EDT 2001


"Cguru" <cguru at bigfoot.com> wrote:

>Thank you very much for your response...I add the line as you said
>self.ent17.insert(END,var1[0][0])
>
>and got the following error:
>Type Error: unscriptable object...

My fault.  I left out one step.  The "query" method returns a results
object; you have to ask for the results tuples using a method of that
object:

>>  rs = pg.DB('blah')
>>
>>  query17 = "select companyname from clients"
>>  var1 = rs.query(query17)

    how_many_rows = var1.ntuples()
    results = var1.getresult()

>>  self.ent17 = Entry (master)

    self.ent17.insert(END, results[0][0])

>>  self.ent17.place(in_=master,x=120,y=30)

--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list