S
Sam
Hello,
Perl newbie here. I am using SQLite3 for a project to learn DBI.
Getting the following error when trying to connect to the database
file: "unable to open database file(1) at dbdimp.c line 94 at tool.cgi
line
16."
-------------- The code -------------------
#!/usr/bin/perl -wT
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser); #Output errors to browser
use DBI;
my $driver = 'SQLite';
my $database = '/path_to_database_file/data_v1.db3'; # db path
my $username = undef; # database username
my $password = undef; # database password
# Set up a connection string specific to this database
my $dsn = "DBI:$driver:database=$database";
# make the actual connection
my $dbh = DBI->connect($dsn, $username, $password) || die DBI->errstr;
# when you're done with the database, disconnect
$dbh->disconnect();
------------------ End Code ----------------------------
What could be the potential problem(s):
1. I made the Sqlite3 database file using SQLite SPY (
http://www.zeitungsjunge.de/delphi/sqlitespy/index.htm ) and then
uploaded it to the directory?
2. The path. The database directory is outside public_html from where
the CGI script executes?
The database file, and the directory where it exists have been chmoded
777.
Also, how can I find out what version of sqlite the DBD::SQLite module
is using?
Perl newbie here. I am using SQLite3 for a project to learn DBI.
Getting the following error when trying to connect to the database
file: "unable to open database file(1) at dbdimp.c line 94 at tool.cgi
line
16."
-------------- The code -------------------
#!/usr/bin/perl -wT
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser); #Output errors to browser
use DBI;
my $driver = 'SQLite';
my $database = '/path_to_database_file/data_v1.db3'; # db path
my $username = undef; # database username
my $password = undef; # database password
# Set up a connection string specific to this database
my $dsn = "DBI:$driver:database=$database";
# make the actual connection
my $dbh = DBI->connect($dsn, $username, $password) || die DBI->errstr;
# when you're done with the database, disconnect
$dbh->disconnect();
------------------ End Code ----------------------------
What could be the potential problem(s):
1. I made the Sqlite3 database file using SQLite SPY (
http://www.zeitungsjunge.de/delphi/sqlitespy/index.htm ) and then
uploaded it to the directory?
2. The path. The database directory is outside public_html from where
the CGI script executes?
The database file, and the directory where it exists have been chmoded
777.
Also, how can I find out what version of sqlite the DBD::SQLite module
is using?