Greg Milby | 5 Mar 2010 18:06
Picon

Re: cannot access the sqlite db

latest status:


my friend Leandro gave me some sample code - it helped some, it can find the db, but it's saying there is no table todo - which i can manually confirm it does exists 
all is still 777/accessible to everyone

code added to code.py:
 import os
PROJECT_ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
database_path = PROJECT_ROOT_PATH + '/home/gmilby/public_html/db/todo_db'
db = web.database(dbn='sqlite', db=database_path)

the manual verification that todo does exsist:
gmilby <at> c2015:~/public_html/db$ sqlite3 todo_db
SQLite version 3.6.10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select title from todo;
Learn web.py 333
sdfasdf44444
sqlite> .quit

complete traceback below:
2010-03-05 17:01:07: (mod_fastcgi.c.2610) FastCGI-stderr: Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/application.py", line 242, in process
    return self.handle()
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/application.py", line 233, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/application.py", line 412, in _delegate
    return handle_class(cls)
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/application.py", line 387, in handle_class
    return tocall(*args)
  File "/home/gmilby/public_html/feedtheguru.com/code_sqlite.py", line 55, in GET
    todos = db.select('todo')
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/db.py", line 641, in select
    return self.query(qout, processed=True)
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/db.py", line 967, in query
    out = DB.query(self, *a, **kw)
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/db.py", line 603, in query
    self._db_execute(db_cursor, sql_query)
  File "/usr/local/lib/python2.6/dist-packages/web.py-0.33-py2.6.egg/web/db.py", line 554, in _db_execute
    out = cur.execute(sql_query.query(paramstyle), sql_query.values())
OperationalError: no such table: todo
-----------------------
Visit My Sites!
http://1-4-u.info | Don't send insanely long links!
www.syrbot.com | My Site
www.syrbotwebdesign.com | My Site New Design (Under Construction)
www.attackr.com | Latest Blog Posts
www.superantispyware.com/superantispyware.html?rid=3971 Remove All The Spyware - Not Just The Easy Ones!



On Fri, Mar 5, 2010 at 10:20 AM, geekbuntu <gmilby <at> gmail.com> wrote:
 i'm having a wicked sqlite3 problem (webpy/sqlite3) - my code works
flawlessly if the db is in the webroot where the code is, but i move
it to a save place and i keep getting t his error:     return
self.db_module.connect(**keywords)
OperationalError: unable to open database file
i even re-created the db in the new location, chmod to 777 -R in the
folder it resides in, and still the problem - ANY advice would be
greatly appreciated
is there any directory-type file to tell sqlite3 where this file is
living now? set paths?
tia,
greg


Gmane