in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

"Unable to open the database file"

Last post 04-06-2008 1:20 AM by juvi. 34 replies.
Page 3 of 3 (35 items) < Previous 1 2 3
Sort Posts: Previous Next
  • 01-20-2008 5:08 PM In reply to

    Re: "Unable to open the database file"

    I have found out, that this issue occurs only under Windows Vista and only if i put my database file into the AppData folder. I have no idea what Vista does with the database file that it blocks access to it or its folder so that sqlite cannot create a journal file. I have no antivirus software running and i have disabled indexing service. I have also noticed that this exception occurs often if i create command objects and execute sql statements inside of the using(...) block. Is there any way to grant sqlite exclusive access to the database file so that no other process can open it for writing?

  • 02-08-2008 2:54 AM In reply to

    Re: "Unable to open the database file"

    Hi. I have this error message as well. Now here's the thing:

    It never happens when debugging or at any other filesystem location on machines with the development environment (Visual C# Express 2005). It however fails to open the database on any (tested) system without Visual. I've double checked the db-path in the connection string, it's always correct...

     Here's the relevant code (trivial, but just in case) :

                private SQLiteConnection m_Conn = new SQLiteConnection("Data Source=" +        Path.GetDirectoryName(Application.ExecutablePath) + "\\db\\default.db");

                MessageBox.Show(m_Conn.ConnectionString);
                m_Conn.Open();

    Any Ideas?

  • 02-08-2008 7:36 AM In reply to

    Re: "Unable to open the database file"

    Easiest thing to do is to try and open the file for read/write access using File.Open().  If that succeeds and the connection fails, then we have a real problem.

  • 02-08-2008 9:31 AM In reply to

    Re: "Unable to open the database file"

    I have tried to open the database file in external editor when there were database connections established from my application. If i modify the file and save it, the database connection is broken. The thing is, that any other program can access database file and block/modify it at any time, what can cause my application to loose database connection. And from the process of my application i could also open the database file in shared read/write mode. Any suggestions to avoid blocking of the database file?

  • 04-06-2008 1:20 AM In reply to

    • juvi
    • Top 25 Contributor
    • Joined on 02-03-2006
    • Posts 30

    Re: "Unable to open the database file"

     hello,

     I just wanted to ask you if this problem is allready fixed or not, because I am now also running into this problem if I install my software under partition C: under Windows Vista.

     thx

    juvi 

Page 3 of 3 (35 items) < Previous 1 2 3
Powered by Community Server (Commercial Edition), by Telligent Systems