Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:10:50+00:00 2026-05-14T07:10:50+00:00

Ok, now I finished developing on the emulator and when I installed on my

  • 0

Ok, now I finished developing on the emulator and when I installed on my test device, I got the error

attempt to write a readonly database

What are the settings to control the DB access? Is this going to be difficult to manage when deployed?

More information … I think I know what is going on … When I look for my DB it is not in the same path as the tutorials. What I like to do is have a group that is below the project’s root folder for “Content.” I added the JustADatabase.sqlite file in this group under my defined path. Since not all paths are writable, I am surmising that my user created path is not writable when installed.

I believe there is a way to use the build/copy script to install the file in the correct place.

Do you think this is the problem? Do you know how to script the fix or how to put the file in the correct location in my project so it is copied correctly? Following is the code leading up to the sqlite-open command with the ‘tutorial’ paths commented-out. This works for reading and may be the cause of the write access denial.

- (void)initializeDatabase {

    // ??? NSArray  *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    // ??? NSString *documentsDirectory = [paths objectAtIndex:0];
    // ??? NSString *pathTutorial = [documentsDirectory stringByAppendingPathComponent: @"JustaDatabase.sqlite"];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"JustaDatabase" ofType:@"sqlite"]; 

    if( sqlite3_open([path UTF8String], &database) == SQLITE_OK ) {
        NSLog(@"%s: opened database %@", __FUNCTION__, path);
    } else {
        NSAssert1(0,@"Failed to open database: '%s'.", sqlite3_errmsg(database));
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:10:51+00:00Added an answer on May 14, 2026 at 7:10 am

    sqlite3 permissions are just file permissions.

    you need to copy the db file to the documents directory, since you can’t write to the file in the bundle directory on the device.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have finished developing my app and now I want to deploy it.. what
I'm developing a personal project. The project is finished, but now I want to
My software handles multiple operations on files, and I have now finished writing the
I finished NerdDinner tutorial and now I'm playing a bit with project. Index page
I've just finished my Android widget. Now I need to have different sizes of
i just finished Coding my PHP application now the coding has become somewhat Huge
I have finished developing the core of a web application I have been working
I have just finished developing an ASP.NET on my local Windows XP machine. I
I have finished developing an archive format in managed C# that is way too
I'm developing now several iOS apps that shared some common thirdy-party libs, plus some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.