Note that there are some explanatory texts on larger screens.

plurals
  1. POSQLite: Cannot open network file programatically, even though worked before
    primarykey
    data
    text
    <p>I have used the code below to open a SQLite database file that sits on a network computer for more than a year now almost on a daily basis. Suddenly this morning, I am not able to open the file programmatically.</p> <pre><code>private Boolean Connect(String strPathFile) { // Initialize the connection object. this.DbConnection = null; try { // DATABASE: Create the connection string and set the settings. String strConnection = @"Data Source=" + strPathFile + @";Version=3;"; // DATABASE: Connect to the database. this.DbConnection = new SQLiteConnection(strConnection); this.DbConnection.Open(); return true; } catch (Exception ex) { MessageBox.Show(ex.Message); } return false; } </code></pre> <p>The file is a network resource in the form "\Server\ShareName\FileName.db" (less the double quotes).</p> <p>Here is the interesting thing. SQLite Administrator has no issues opening up the network database file, none, and repeatedly. I can also open up the file locally. I copied the file to my local drive and simply changed the path inside Visual Studio 2012 (VS2012).</p> <p>The server seemed fine. It had gone through a reboot at some point since the last time that I checked on it. I presume a Microsoft Update. File Explorer has no issues browsing the folder, and as I said SQLite Administrator can open the network file.</p> <p>I checked once again on permissions and everyone has full control as well as the server's users have full control, both on the security permissions and on the share permissions. I checked the folder and file, and permissions are the same. I expected as much, because SQLite Administrator can open the file. The server does not have a firewall set up, Windows Firewall or otherwise. I rechecked that this morning as well. Again, SQLite Administrator would have complained about that.</p> <p>I verified writing, by making a copy of the file on the network drive using File Explorer. That had no issues.</p> <p>The sever is a Windows Server 2003. I am using Windows 7 Professional 64-bit.</p> <p>I also tried to open up the database in read only mode, but that failed as well. I was expecting that behavior. SQLite Administrator still works nicely.</p> <p>I tried various other connection strings including SQLiteConnectionStringBuilder() just to see what happens, and all roads lead to Rome, namely:</p> <pre><code>System.Data.SQLite.SQLiteException occurred HResult=-2147467259 Message=unable to open database file Source=System.Data.SQLite ErrorCode=14 StackTrace: at System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool) at System.Data.SQLite.SQLiteConnection.Open() at SQL.cSQL.Connect(String strPathFile) in C:\&lt;Path to source file&gt;:line 367 InnerException: </code></pre> <p>Thoughts?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload