is the directory containing the db writable by your web/apache user?
iirc, the directory has to be writable, not just the file.

On Fri, Mar 7, 2008 at 8:21 AM, Brian Blais <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  I am trying to insert rows into a sqlite database, and am getting the
>  error:  SQL logic error or missing database.  This only happens with
>  inserts, not selects, which are working fine.
>
>  I am not sure how to debug this one.  The insert command I have is:
>
>              web.insert('comments',who=user._id_,
>                 comment=comment,
>                 filename=pic.filename,
>                 family_id=pic.family_id,
>                 person_id=pic.person_id,
>                 created=datetime.now(),
>                 picture=pic._id_)
>
>  where all of the data is correct, and of the correct type, as far as
>  I can tell.  I am loading the database with:
>
>      web.config.db_parameters = dict(dbn='sqlite',
>  db='family_database.db')
>
>  right before the web.run() command.  for what its worth, the
>  standalone code below works.  I know that it is finding the database,
>  because the selects right before then are working.  Is there
>  something I am missing?
>
>
>  thanks,
>
>
>                         Brian Blais
>
>
>
>
>
>
>  from datetime import date,datetime
>  import sys
>  import web
>
>
>  if __name__ == "__main__":
>
>      web.connect(dbn='sqlite', db='family_database.db')
>
>      commentsdb = web.select('comments')
>      comments=[x for x in commentsdb]
>
>      print "comments: ",comments
>
>
>      userdb = web.select('users')
>      users=[x for x in userdb]
>
>      print "users: ",users
>      sys.stdout.flush()
>
>
>      web.insert('comments',who=1,
>         comment='this is a test',
>         filename='filename here',
>         family_id=0,
>         person_id=0,
>         created=datetime.now(),
>         picture=1)
>
>
>      commentsdb = web.select('comments')
>      comments=[x for x in commentsdb]
>
>      print comments
>      sys.stdout.flush()
>
>
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to