Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sqlite open db on local server
#1
when I try to open a sqlite db file that is shared on a local server it fails with 'failed. unable to open database file.' message.

If I open the same on the server itself it open fine. 

str dbfile="c:\Users\Public\Documents\lb\lead.db3"
Sqlite db3.Open(dbfile)

while this fails:

str dbfile="\\win-kl55s2pio18\Users\Public\Documents\lb\lead.db3"
Sqlite db3.Open(dbfile)

If I use the program 'DB Browser for SQLite' (windows version) I am able to open the database on the server from a local computer. 

Seems the problem must be in the dbfile string, but not sure. I tried many variations. 

Any ideas?
#2
Try
https://stackoverflow.com/questions/1730...ked-before
#3
thanks for that link. I tried all the suggested methods with no luck. I was hoping the mapping of a Drive to the network folder would work, but same result. failed. unable to open database file.
#4
Works when I test it with normal network, but I remember it failed when the file was on a virtual PC.

Sqlite.Open passes the path directly to the SQLite API function sqlite3_open_v2. Look in its documentation. Search the internet.

https://www.sqlite.org/c3ref/open.html
#5
When you test what is the dbfile file path you used?
#6
Sqlite db1.Open("\\VISTA32\shared\test.db3")
#7
Quote:If I use the program 'DB Browser for SQLite' (windows version) I am able to open the database on the server from a local computer.

Maybe different sqlite dll version. Try to replace the dll in QM folder with the dll of 'DB Browser for SQLite' (if exists and is 32-bit), or with the newest dll version (32-bit) wherever you'll find it on the internet.

If 'DB Browser for SQLite' is open-source, look in its source code, how it opens databases.

Try to open as read-only.
Sqlite db1.Open("\\VISTA32\shared\test.db3" 3)


Forum Jump:


Users browsing this thread: 1 Guest(s)