Solved

sqlite error "Unable to open database file"

Posted on 2010-08-15
3
1,746 Views
Last Modified: 2013-12-21
Hi,

I have code that I am trying to open sqlite database, I am getting error "Unable to open database file". My path to database is correct. I am working on Windows mobile,

My code:
string s = "Data Source=" + AppPath() + "\\DB\\test.sqlite";
            SQLiteConnection conn = new SQLiteConnection();
            conn.ConnectionString = s ;
            try
            {
            conn.Open();
            }
            catch(Exception ex)
            {
           
            }

Please help me to solve issue
0
Comment
Question by:mkk39
3 Comments
 
LVL 3

Expert Comment

by:bkokx
ID: 33444300
Do you have read/write access in that folder?
0
 
LVL 28

Expert Comment

by:strickdd
ID: 33444710
Definitely a permissions issue of some sort. Verify the user you are running under. Then on the folder and the test.sqlite file, right click and go to security. Verify that your user has all but Full Control on those. Easiest way is to check "Full Control" and then uncheck it, this will select everything but full control.
0
 
LVL 5

Accepted Solution

by:
sindhuxyz earned 500 total points
ID: 33548628
This is path issue. Make sure the path
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now