I tried using the path "c:\ex1.db" and it worked. I was using "ex1.db"
before.
Thanks everyone for the help. This is a great community and maybe next
time I will ask a harder question :)
--
http://mail.python.org/mailman/listinfo/python-list
> bapolis <[EMAIL PROTECTED]> writes:
> con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES)
^^
Did you really intend this? Since you're opening a database in memory, you
will have access to tbl1 only if you create the table after the con
[EMAIL PROTECTED] wrote:
> I'm getting the following error:
>
> pysqlite2.dbapi2.OperationalError: no such table: tbl1
>
> Here's my code:
>
> from pysqlite2 import dbapi2 as sqlite
> con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES)
> cur = con.cursor()
> cur.execute("select *
OK, it's better.
You use relative path to your file 'ex1', are you really sure that you
open the right file and not creating another DB in another path ?
Try to use absolute path (r'c:\temp\ex1').
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]
| my bad. that was the wrong code, here is my code:
|
| from pysqlite2 import dbapi2 as sqlite
| con = sqlite.connect("ex1")
| cur = con.cursor()
| cur.execute("select * from tbl1")
| print cur.fetchall()
Just a thought... is the file containing
your database called -- exactly
Is it the complete code ?
If so then you have to create the table each time you connect to the
DB.
You use an in-memory DB (":memory:") so all the data of the DB is lost
when you close the connection, including the schema of the DB.
--
http://mail.python.org/mailman/listinfo/python-list
my bad. that was the wrong code, here is my code:
from pysqlite2 import dbapi2 as sqlite
con = sqlite.connect("ex1")
cur = con.cursor()
cur.execute("select * from tbl1")
print cur.fetchall()
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]
| I'm getting the following error:
|
| pysqlite2.dbapi2.OperationalError: no such table: tbl1
|
| Here's my code:
|
| from pysqlite2 import dbapi2 as sqlite
| con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES)
| cur = con.cursor()
| cur.execute("select * from