views:

61

answers:

1

hi all,

I try to connect to a remote sqlite file and when I try to open the file I get an error:

if (sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {

...

}else {
    // Even though the open failed, call close to properly clean up resources.
    sqlite3_close(database);
    NSAssert1(0, @"Failed to open database with message '%s'.", sqlite3_errmsg(database));
    // Additional error handling, as appropriate...
}

When I try to output the database path, it gives the correct url ( it's a local network setup and the app connects to a static ip, searching for the binary sqlite dump )

2010-04-27 12:47:43.017 bbc_v1[4904:207] loading db path: http://192.168.2.10:8888/bbc.sqlite

Tested and the file exists..

Is it possible to connect to a remote sqlite file? Or is this only possible when it's inside the app bundle?

Greets, Thomas

A: 

sqlite3_open take a FILE name, not a URL.

I don't think sqlite do provide any remote access as it is explicitly designed for embedded use.

You should download your file and save it on the device, then open it.

dodecaplex