Discussion:
How to connect to a remote SQLite database
Jonathan Vila Lopez
2005-11-07 07:45:07 UTC
Permalink
Hello.

I would like to connect to a SQLite database that is located in a remote
host....so, if the remote host is in the same local net a \\host\dir\file
should work, but I have tried and doesnt work.... and how about IP connect ?
like ( 000.000.000.000:\dir\file )

By the way, I am using Python 2.3.

Thanks in advance
Oleg Broytmann
2005-11-07 08:24:23 UTC
Permalink
Post by Jonathan Vila Lopez
so, if the remote host is in the same local net a \\host\dir\file
should work, but I have tried and doesnt work....
What is the error?
Post by Jonathan Vila Lopez
and how about IP connect ?
like ( 000.000.000.000:\dir\file )
SQLite is an embedded database, not a client/server system. Though I
heard there is a server for SQLite, I don't know if the client has a Python
wrapper.

Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd-CkPfPOWUVkeHXe+***@public.gmane.org
Programmers don't die, they just GOSUB without RETURN.
Jonathan Vila Lopez
2005-11-07 08:57:08 UTC
Permalink
I have this system :
client = Win 98
host = Linux Debian

With SQLiteBrowser I can connect to the database using
"\\samba\pub\users\jonathan\db\mydb".... but trying the same inside my
python program ( version 2.3 using pysqlite version 1.0.1 )....
The error is : "unable to open database"

Thanks in advance.
Oleg Broytmann
2005-11-07 09:19:26 UTC
Permalink
Post by Jonathan Vila Lopez
client = Win 98
host = Linux Debian
With SQLiteBrowser I can connect to the database using
"\\samba\pub\users\jonathan\db\mydb".... but trying the same inside my
python program ( version 2.3 using pysqlite version 1.0.1 )....
The error is : "unable to open database"
Any chance you've messed backslashes?! Please remmeber that in Python
the literal "\\" is actually ONE backslash! Python's compiler interprets
and eats backslashes! Either write
"\\\\samba\\pub\\users\\jonathan\\db\\mydb" or use Python raw strings:
r"\\samba\pub\users\jonathan\db\mydb". Or pass the value
"\\samba\pub\users\jonathan\db\mydb" to python script from a config file or
via the command line.

Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd-CkPfPOWUVkeHXe+***@public.gmane.org
Programmers don't die, they just GOSUB without RETURN.
Loading...