Re: [sqlite] sqlite3.OperationalError: unable to open database file

2009-07-07 Thread nixonron

Doug,

That worked. Thanks.



Doug Currie-2 wrote:
> 
> 
> On Jul 7, 2009, at 4:36 PM, nixonron wrote:
> 
>> conn = sqlite3.connect('c:\Ujimadata\aid.sqlite')
> 
> Perhaps you meant
> 
> conn = sqlite3.connect('c:\\Ujimadata\\aid.sqlite')
> 
> or
> 
> conn = sqlite3.connect('c:/Ujimadata/aid.sqlite')
> 
> e
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/sqlite3.OperationalError%3A-unable-to-open-database-file-tp24380858p24381417.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3.OperationalError: unable to open database file

2009-07-07 Thread Doug Currie

On Jul 7, 2009, at 4:36 PM, nixonron wrote:

> conn = sqlite3.connect('c:\Ujimadata\aid.sqlite')

Perhaps you meant

conn = sqlite3.connect('c:\\Ujimadata\\aid.sqlite')

or

conn = sqlite3.connect('c:/Ujimadata/aid.sqlite')

e

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3.OperationalError: unable to open database file

2009-07-07 Thread nixonron

I've created a database in a directory called Ujimadata on my C: drive. I'm
using sqlite in Django project. Here is the code I'm using in Komodo when I
get the "sqlite3.OperationalError: unable to open database file" error.


import sqlite3
from sluggy import slugify

conn = sqlite3.connect('c:\Ujimadata\aid.sqlite')
cursor = conn.cursor()
cursor.execute("""SELECT country_code, country_name FROM country""")
for country_code, country_name in cursor.fetchall():
   cursor.execute("UPDATE country SET slug=%s WHERE country_code=%s",
   (slugify(country_name), country_code))
   conn.commit()


Here is the error message:

Traceback (most recent call last):
  File "C:\Python25\ron_scripts\sqliteConn.py", line 4, in 
conn = sqlite3.connect('c:\Ujimadata\aid.sqlite')
sqlite3.OperationalError: unable to open database file

I also tried to use sqlite within python on the command line.

import sqlite3
conn = sqlite3.connect('c:\Ujimadata\aid.sqlite')
c = conn.cursor()
c.execute("select * from country")

I get this error

Traceback (most recent call last):


sqlite3.OperationalError: unable to open database file

Anyone have any ideas how to fix this problem?

-- 
View this message in context: 
http://www.nabble.com/sqlite3.OperationalError%3A-unable-to-open-database-file-tp24380858p24380858.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users