in reply to Table in SQLite

You can put your database file anywhere provided the script has access to that file. Like i can put file add.db in /home/neeraj. To access the file , i use the followinf code :-
my $str= "DBI:SQLite:/home/neeraj/add.db"; $dbh= DBI->connect( $str ) || die "Can't connect to database: $DBI::e +rrstr!" ;

Replies are listed 'Best First'.
Re^2: Table in SQLite
by Juerd (Abbot) on Jul 16, 2004 at 08:29 UTC

    You can put your database file anywhere provided the script has access to that file.

    It also needs write permissions on the directory. That's why I usually create a directory for SQLite databases.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Re^2: Table in SQLite
by Anonymous Monk on Jul 16, 2004 at 08:55 UTC
    before this I was using MySQL, the database was kept in c:/MySQL/Data/ but in my script it like this

    $dbh= DBI->connect("dbi:$dbtype:$dbname_ss;$dbip", "$dbuser", "$dbpass");


    my $dbname_ss = "nehnu";
    my $dbname_base_app = "hrms_base_ranhil";
    my $dbip = "localhost";
    my $dbuser = "root";
    my $dbpass = "";
    my $dbtype = "mysql";

    So when I change to DBD::SQLite I change it but, it didn't work. I don't know how the last time I use MySQL it refer to c:/MySQL/Data/databasename but it work...

      The difference is that MySQL runs as a server and accesses a directory to store its database, and SQLite is library that reads a single file.

      DBD::mysql connects to the server (localhost), chooses a database (nehnu), which is mapped to a disk location (c:/MySQL/Data/database), and logs in with a user (root). The DSN contains all that info:

      DBI->connect("dbi:mysql:nehnu;localhost", "root", "");

      DBD::SQLite opens the database file. The DSN just needs the filename:

      DBI->connect("dbi:SQLite:/SQLite/Data/database.sqlt");