View Ticket
Not logged in
Ticket UUID: 283344397b4a4d8b2e6253805711e43b10285eaf
Title: Cannot open SQLite database file on network share
Status: Closed Type: Feature_Request
Severity: Important Priority: Medium
Subsystem: Connection Resolution: Fixed
Last Modified: 2014-02-28 01:34:19
Version Found In:
User Comments:
anonymous added on 2014-02-27 11:46:09:

Using System.Data.SQLite, I am unable to open a connection to a database file on a network share from my .NET windows application. When I try and do so, I get the following exception:

ErrorCode: 14
Message: "unable to open database file"
ResultCode: CantOpen
    at System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)
    at System.Data.SQLite.SQLiteConnection.Open()
    at [MyApp.MyCode ...]

I've ensured that I have full read/write permission on the network share. I am able to save, open and edit other types of file there. I had been using System.Data.SQLite previously, and was not getting this error - I've just tested it on the exact same network share and it can open files without a problem.

Interestingly, with, the following statement successfully creates a file on the network share:


But immediately followed by:

using (var connection = new SQLiteConnection(string.Format("Data Source={0}", fileName))) {

It crashes with the above exception on the line connection.Open();.

Can you help? Has a breaking change been made somewhere between version and

In case it's relevant, my data source string is simply in the format \\SERVERNAME\sharename

(Also, I can successfully use to create/open local database files without a problem)


anonymous added on 2014-02-27 12:26:02:
OK, I found a solution on StackOverflow:

(I used the first option - four leading backslashes)

I'm leaving this open in case it's a bug anyway. At the very least, I'd suggest adding a detection and output trace warning about not supporting the "\\SERVER\share" data source format.


mistachkin added on 2014-02-27 22:27:25:
This is a feature request to issue a warning for network share paths that do not
being with four backslashes.

mistachkin added on 2014-02-28 01:34:19:
Feature request is now on trunk via check-in [c632d5743c].