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 8181195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:26:24+00:00 2026-06-07T00:26:24+00:00

I am using the firefox sqlite manager to help me building an iphone app.

  • 0

I am using the firefox sqlite manager to help me building an iphone app. In which I include an UPDATE query, which works perfectly in the iPhone simulator. However, it fails when I run from the real machine (the iphone). There is no error, it just does not update the db.

I am thinking of two possible causes:
1) The db it updates is not the one as in simulator
2) The db I read is not the one that is updated

Does anyone have similar experience?

Code as follows:

        NSFileManager *fileMgr = [NSFileManager defaultManager];
        NSString *dbPath = [[[NSBundle mainBundle] resourcePath ]stringByAppendingPathComponent:@"Exercises.sqlite"];

        BOOL success = [fileMgr fileExistsAtPath:dbPath];
        if(!success)
        {
            NSLog(@"Cannot locate database file '%@'.", dbPath);
        }
        if(!(sqlite3_open([dbPath UTF8String], &db) == SQLITE_OK))
        {
            NSLog(@"An error has occured.");
        }

        NSString *ranID = [@"UPDATE Status SET money = " stringByAppendingFormat:@"%d", money + 100];

        const char *sql2 = [ranID UTF8String];
        sqlite3_stmt *sqlStatement2;
        if(sqlite3_prepare(db, sql2, -1, &sqlStatement2, NULL) != SQLITE_OK)
        {
            NSLog(@"Problem with prepare statement 2");
        }
        if (sqlite3_step(sqlStatement2)==SQLITE_ROW) 
            NSLog(@"succeed");

Thanks in advance.

  • 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-06-07T00:26:25+00:00Added an answer on June 7, 2026 at 12:26 am

    What happening is that you are trying to write inside the database that is in your bundle, you dont have write access to files in your bundle, you will need to copy it to Documents directory if you want to update the database

    To copy the database file

    NSString *documentsPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Exercises.sqlite"];
    
    [[NSFileManager defaultManager] copyItemAtPath:dbPath toPath:documentsPath error:NULL];
    

    Then always use the new file path (documentsPath)to access the database

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

Sidebar

Related Questions

I'm using the Firefox sqlite manager addon and I have a database table named
When creating a SQLite database (I'm using the SQLite Manager Firefox plugin), I naturally
I am an iPhone developer. I am using SQLite Manager (SQLite 3) on my
I am using Firefox's native JSON.parse() to parse some JSON strings that include regular
I'm using Firefox 8.0.1 margin-top is not working as expected, can anyone help? thx.
I have to write a query in sqlite to update the record if it
I have created a data base (.sqlite) using SQLiteManager plugin for firefox,now I want
I am using Firefox SQLIte plugin and I have an option to export as
I'm trying to read the date fields of Firefox places.sqlite datedase using ADO.NET and
Using firefox 5 when i run window.getComputedStyle(document.getElementsByTagName(img)[0], null); I get the complete css file,

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.