Re: Error Opening Database

[email protected]
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <OFFB9EC6A1.E35482CC-ON85257210.0077D79F-85257210.00781A95@bankofny.com>
I am not using sqlite3 yet, so this may not help at all:

I did the following test:

from pysqlite2 import dbapi2 as sqlite
projname = 'this'
sqlite.connect(projname)
<pysqlite2.dbapi2.Connection object at 0x00DF4C50>

This created a file this on my desktop, so everything worked for me. So
your code looks fine to me, and what's worse, works fine for me too.

Sorry,

Hopefully someone else can help.

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:       "For users of the pysqlite database module." <pysqlite-IAPFreCvJWPBWskQ1e/[email protected]>       
                      .com>                        cc:                                                                                     
                      Sent by:                     Subject:  Re: [pysqlite] Error Opening Database                                         
                      pysqlite-bounces@list                                                                                                
                      s.initd.org                                                                                                          
                                                                                                                                           
                                                                                                                                           
                      10/23/2006 05:13 PM                                                                                                  
                      Please respond to                                                                                                    
                      "For users of the                                                                                                    
                      pysqlite database                                                                                                    
                      module."                                                                                                             
                                                                                                                                           
                                                                                                                                           




On Mon, 23 Oct 2006, [email protected] wrote:

> I think you need this:
>
> self.con = sqlite.connect('projname', isolation_level=None)
>
> unless projname is a variable.

Greg,

   It _is_ a variable. The sequence is:

   1) When application is invoked, a message pops up reminding us that a
file
(i.e., sqlite3 database) needs to be opened or created first.

   2) From the File->New menu the following method is called:

   def OnFileNew(self, event):
     """ Create a new file and open it."""
     self.dirname = ''
     wd = wx.DirDialog(self, "Chose the default directory", ".",
style=wx.DD_NEW_DIR_BUTTON)
     if wd.ShowModal() == wx.ID_OK:
       dirname = wd.GetPath()
       ted = wx.TextEntryDialog(self, "Enter the project name", "New
Project Name", "",
                                style=wx.RAISED_BORDER|wx.OK|wx.CANCEL)
       if ted.ShowModal() == wx.ID_OK:
         projname = ted.GetValue()
         tcName = self.mainNB.pane_1.tcName
         tcName.WriteText(projname)
         self.OnOpenDB(projname)
         ted.Destroy()
       wd.Destroy()

   3) Three lines from the bottom of that method is the call to
OnOpenDB.

   Of course, this does not mean to imply that I have it correct at all.
:-)

Thanks,

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.