Hi All,
I am newbie in Perl Scripting. I have a requirement where I need to execute sql file on an Sqlite database.
sqlite database has been set with password.
I could connect to database. But when I try to execute sql statements its giving as "DBD::SQLite::d b prepare failed: file is encrypted or is not a database at <SQL> line 1." Here is my code
I created that db in Lita(SqLite Administration Tool)and have set the password.
I am running the perl scripts on Windows XP using ActivePerl version 5.12.2.
I am newbie in Perl Scripting. I have a requirement where I need to execute sql file on an Sqlite database.
sqlite database has been set with password.
I could connect to database. But when I try to execute sql statements its giving as "DBD::SQLite::d b prepare failed: file is encrypted or is not a database at <SQL> line 1." Here is my code
Code:
use DBI; my $dbfile = '../myData.db'; # your database file my $dbh = DBI->connect( # connect to your database, create if needed "dbi:SQLite:dbname=$dbfile", # DSN: dbi, driver, database file "", # no user "xxxxxxxxxxxxxxxxxxxx", #password { RaiseError => 1 }, # complain if something goes wrong ) or die $DBI::errstr; open SQL, "<../myDB.sql" or die $!; while(<SQL>) { ($dbh->prepare($_))->execute(); } close SQL;
I am running the perl scripts on Windows XP using ActivePerl version 5.12.2.
Comment