开发者

Perl And Sqlite

Can someone tell me how to access a sqlite3 database from perl.

the code

use DBI;
use DBD::SQLite;

my $dbh = DBI->connect(
  "dbi:SQLite:dbname=/cb开发者_开发问答illdata/media/database/collector.db","",""
) or die "Cannot connect: $DBI::errstr";

returns error

DBI connect('dbname=/cbilldata/media/database/collector.db','',...) failed: database disk image is malformed at ./db.pl line 7

Cannot connect: database disk image is malformed at ./db.pl line 7.


Either your version of DBD::SQLite is a very old one that uses SQLite 2 and not 3, or the message is accurate and your database is corrupt.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜