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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:02:55+00:00 2026-05-27T13:02:55+00:00

Sqlite3 database is not connected in iPhone 4 running iOS 5.0.1, on both Wi-Fi

  • 0

Sqlite3 database is not connected in iPhone 4 running iOS 5.0.1, on both Wi-Fi and cellular networks. My apps 4 times rejected in Itunes Apple store due to this reason.
I am using XCode 3.2.4 using iPhone 3.2 iOS 4.1. where this app running well.

I write this codes-

/// @ AppDelegate.m file 

-(void)createDatabaseIfNeeded {

BOOL success;
NSError *error;

//FileManager - Object allows easy access to the File System.
NSFileManager *FileManager = [NSFileManager defaultManager];

//Get the complete users document directory path.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

//Get the first path in the array.
NSString *documentsDirectory = [paths objectAtIndex:0];


//Create the complete path to the database file.
NSString *databasePath = [documentsDirectory stringByAppendingPathComponent:@"passmanager.sqlite"];

//Check if the file exists or not.
success = [FileManager fileExistsAtPath:databasePath];

//If the database is present then quit.
if(success) return;

//the database does not exists, so we will copy it to the users document directory]
NSString *dbPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"passmanager.sqlite"];

//Copy the database file to the users document directory.
success = [FileManager copyItemAtPath:dbPath toPath:databasePath error:&error];

//If the above operation is not a success then display a message.
//Error message can be seen in the debugger's console window.
if(!success)
    NSAssert1(0, @"Failed to copy the database. Error: %@.", [error localizedDescription]);
}


-(void)applicationDidFinishLaunching:(UIApplication *)application{

// createDatabaseIfNeeded method for first time to create database in new iPhone
[self createDatabaseIfNeeded];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];

}

And Error gives accroding to Apple in the code in Some ViewController page

// @ viewController.m

sqlite3 *database;

int result = sqlite3_open("passmanager.sqlite", &database);

if(result != SQLITE_OK){
sqlite3_close(database);
UIAlertView *alert = 
[[UIAlertView alloc] initWithTitle:@"Database Connected" 
                       message:@"No" 
                      delegate:self 
                     cancelButtonTitle:@"OK" 
                     otherButtonTitles:nil]; 

[alert show];     
[alert release];            
}
else{ 
  // some stuff
}

Every time Apple complained that if Condition is true as “Database Connected No”
While In my system else part is executing.
Please help me. Thax in advanced.

  • 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-27T13:02:55+00:00Added an answer on May 27, 2026 at 1:02 pm

    It looks like the path of the database you are trying to open is incomplete, it should be

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *databasePath = [documentsDirectory stringByAppendingPathComponent:@"passmanager.sqlite"];
    
    int result = sqlite3_open([databasePath UTF8String], &database);
    

    as that is what you set in createDatabaseIfNeeded

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

Sidebar

Related Questions

I am developing an iPhone application that persists data to a SQLite3 database. For
i have a problem in sqlite database connected with iphone sdk for eg. when
I've created an sqlite3 database from the command line and inserted several records. My
-(void) readProductsFromDatabase { // Setup the database object sqlite3 *database; // Init the animals
I have the following table in a SQLite3 database: CREATE TABLE overlap_results ( neighbors_of_annotation
I'm writing an application in Delphi which uses an SQLite3 database. I'd like to
I have a Sinatra DataMapper app hitting a sqlite3 database that I am attempting
I am able to create a connection to a local sqlite3 database ( Using
I'd like to run some ALTER TABLE statements on a sqlite3 database. What happens
Suppose I insert a data point into a sqlite3 database on a nightly basis.

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.