I use sqlite3 with python. I can CRUD tables via command line.
I can also successfully select, insert and delete (!) records via python. However, when I (within the very same connection context) try to update I get the exception: "unable to open database file".
I am puzzled, any ideas?
PS: The tables were created via Django's manage.py syncdb if this is of any relevance. PPS: I am running the code through CGI (granted all permissions to the file, that's why I can also add to the database)
Sorry missed the code:
sDb = 'this\is\my\db'
conn = sqlite3.connect( sDb )
cursor = conn.cursor()
# below works:
sSql = "insert into app_filestamp ( file_id, sFileStamp ) values ( 12, 'YYYYY' )"
# below raises the error
sSql = "update app_filestamp set sFileStamp='XXXXX' where id=13"
cursor.execute( sSql )
conn.commit()
conn.close()
"Solution"
This awkward behaviour (insert works, update not) did only happened on a Windows environment. Thanks for all your input; since this is obviously no known issue I re-thought my approach and got rid of the need for CGI. Bear with me that I did not further investigate the issue.