Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Ah ah ah Corion what a shame from my part :)

I modified the code but it fails anyway with empty var (both cookiesTEST.sqlite and cookies.sqlite tested) so it access the DB but still fails reading it

use strict; use warnings; use Data::Dumper; use DBI; use DBD::SQLite; my $db = $ENV{AppData}.'\Mozilla\Firefox\Profiles\nwk2oixj.default-rel +ease\cookiesTEST.sqlite'; die "DB file not found!" unless -e $db; print "sqlite DBD version: $DBD::SQLite::sqlite_version\n"; my $dsn = qq(dbi:SQLite:dbname=$db); my $user; my $password; my %dbi_options = ( RaiseError => 1, PrintError => 1, sqlite_open_flags => 'SQLITE_OPEN_READONLY', ); my $dbh = DBI->connect($dsn, $user, $password, \%dbi_options); my $sth = $dbh->prepare(q(SELECT * FROM moz_cookies )); $sth->execute(); # PS added this and it works :) print Dumper $sth->fetchall_arrayref({}); __END__ sqlite DBD version: 3.39.4 $VAR1 = [];

L*

PS ..obviously executing the statement helps :) thanks 1nickt++

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re^2: DBI DBD::SQLite unable to open Firefox cookies.sqlite database by Discipulus
in thread DBI DBD::SQLite unable to open Firefox cookies.sqlite database by Discipulus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-25 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found