System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
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: (text/html)
<p>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:</p>

<p>
<b>System.Data.SQLite.SQLiteException<br />
ErrorCode: 14<br />
Message: "unable to open database file"<br />
ResultCode: CantOpen<br />
StackTrace:<br />
&nbsp;&nbsp;&nbsp;&nbsp;at System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool)<br />
&nbsp;&nbsp;&nbsp;&nbsp;at System.Data.SQLite.SQLiteConnection.Open()<br />
&nbsp;&nbsp;&nbsp;&nbsp;at [MyApp.MyCode ...]</b>
</p>

<p>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.</p>

<p>Interestingly, with 1.0.91.0, the following statement successfully creates a file on the network share:</p>

<p><b>SQLiteConnection.CreateFile(fileName);</b></p>

<p>But immediately followed by:</p>

<p><b>using (var connection = new SQLiteConnection(string.Format("Data Source={0}", fileName))) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;connection.Open();<br />
&nbsp;&nbsp;&nbsp;&nbsp;...<br />
}</b></p>

<p>It crashes with the above exception on the line <b>connection.Open();</b>.</p>

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

<p>In case it's relevant, my data source string is simply in the format <b>\\SERVERNAME\sharename</b></p>

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

<p>Thanks.</p>

anonymous added on 2014-02-27 12:26:02: (text/x-fossil-plain)
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: (text/x-fossil-plain)
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: (text/x-fossil-plain)
Feature request is now on trunk via check-in [c632d5743c].