Forums

Database trouble

Hi I'm trying to connect to a sqlite database, and I keep getting a "no such table" error; however, I can see the table in a bash console. I connect to the db in two places, in the web application itself, and in an associated python file. I think it's the web app that's throwing the error, but I don't get a line number or anything for the error. I've trying copying the database into a new one, but that doesn't seem to work either. If I have to recreate the database, that's fine, but I'd love to fix it first.

Are you referring to your database file using a relative path in the web app? I have tripped over this a few times. If you use an absolute path to your database file, it should work out fine.

I'm using /home/baldwincs/dbname. Should I be using something different? I actually recreated the database, and I'm still getting the same error.

I had the absolute path in the web app, but not in the .py file. Changed it in the .py file and that did the trick. Funny, because I've used relative before and had not trouble. Thanks!