Re: Please Explain This Error

[email protected]
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <OF793560DE.9EBE028A-ON8525721A.00724EE4-8525721A.00726175@bankofny.com>
Just saw you bug, you have self.cur, then you say cur.fetchone() it
should be self.cur.fetchone()


Thanks,

Greg Givler
Information Technology
Lockwood®
10 Valley Stream Parkway
Malvern, PA 19355
Phone: (484) 605-4826
Email: [email protected]


                                                                                                                                           
                      Rich Shepard                                                                                                         
                      <rshepard@appl-ecosys        To:       [email protected]                                                      
                      .com>                        cc:                                                                                     
                      Sent by:                     Subject:  [pysqlite] Please Explain This Error                                          
                      pysqlite-bounces@list                                                                                                
                      s.initd.org                                                                                                          
                                                                                                                                           
                                                                                                                                           
                      11/02/2006 03:21 PM                                                                                                  
                      Please respond to                                                                                                    
                      Rich Shepard; Please                                                                                                 
                      respond to "For users                                                                                                
                      of the pysqlite                                                                                                      
                      database module."                                                                                                    
                                                                                                                                           
                                                                                                                                           




   In my wxPython application, each notebook page is a separate module
file.
I insert, update, and select records from the sqlite3 database in each
of
these modules. Until now, python has not complained about opening the
application. But, in the module with the class 'modPolicy' I get this
error:

   File "/data1/eikos/policyPage.py", line 60, in __init__
     self.cur.execute("select * from component where category =
'natural';")
AttributeError: 'modPolicy' object has no attribute 'cur'

   The offending line is in the __init__ method:

     natComp = []
     self.cur.execute("select * from component where category=natural;")
     row = cur.fetchone()
     while row:
       natComp = row[2]
       # get next row
       row = cur.fetchone()
     for x in natComp:
       polID = self.polTree.AppendItem(self.natID, 'x')

   Every reference to the open database cursor in the other modules is
written the same way, so I don't see what is broken in the above syntax.

   Clues greatly appreciated.

Rich

--
Richard B. Shepard, Ph.D.               |    The Environmental
Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax:
503-667-8863
_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please call the help desk at ext 4850
______________________________________________________________________




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.