Subject: | file is encrypted or is not a database on iPhone4 |
Using coredev.nl's perl on iphone 3gs or iphone 4 on iOS 5.0.1, I try to
open /var/mobile/Library/AddressBook/AddressBook.sqlite, but I get an error:
DBD::SQLite::db prepare failed: file is encrypted or is not a database
at g.pl line 8.
the sqlite3 command works just fine:
# echo "SELECT value FROM ABMultiValue WHERE label = 1;" | sqlite3
/var/mobile/Library/AddressBook/AddressBook.sqlitedb
(267) 555-6888
(267) 555-6999
2675550669
When copied over to a debian box, dbd::sqlite reads AddressBook.sqlite
just fine.
dbd::sqlite works fine on several other databases on the iphone; the
only one I've found that it's confused about is AddressBook.
if anyone is interested in helping fix this problem, i'd gladly let you
ssh into my iphone for dev/testing.
Subject: | g.pl |
#!perl
use DBI;
use strict;
my $dsn =
'DBI:SQLite:dbname=/var/mobile/Library/AddressBook/AddressBook.sqlitedb';
my $dbh = DBI->connect($dsn);
my $sql = "SELECT value FROM ABMultiValue WHERE label = 1";
my $sth = $dbh->prepare($sql);
$sth->execute;