System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2014-02-28
01:34 Closed ticket [283344397b]: Cannot open SQLite database file on network share plus 4 other changes artifact: 8cc39694ca user: mistachkin
01:32
Add warning message when a possibly malformed UNC file name is detected when attempting to open a database connection. Pursuant to [283344397b]. check-in: c632d5743c user: mistachkin tags: trunk
2014-02-27
22:27 Ticket [283344397b] Cannot open SQLite database file on network share status still Open with 5 other changes artifact: 7683a6b179 user: mistachkin
12:26 Ticket [283344397b]: 6 changes artifact: 741cdaa4a0 user: anonymous
11:46 New ticket [283344397b]. artifact: 5d54955e4b user: anonymous

Ticket Hash: 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: 1.0.91.0
User Comments:
anonymous added on 2014-02-27 11:46:09:

Using System.Data.SQLite 1.0.91.0, 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:

System.Data.SQLite.SQLiteException
ErrorCode: 14
Message: "unable to open database file"
ResultCode: CantOpen
StackTrace:
    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 1.0.81.0 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 1.0.91.0, the following statement successfully creates a file on the network share:

SQLiteConnection.CreateFile(fileName);

But immediately followed by:

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

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

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

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

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

Thanks.


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

http://stackoverflow.com/a/18506097/672827

(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.

Thanks.

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].