From: Katherine Don
Date: Fri Dec 19 09:32:01 2008
Subject: [greenstone-devel] Question
In reply to: 2a11c1db0812170130p3a247fabsc49468c6ce1df660-mail-gmail-com

Hi Stefan

What are you trying to do exactly? You don't need a dbi file to build
the demo collection. You can just run the Librarian Interface, open the
demo collection (File->Open), then go to the Create tab and click build
collection.

Regards,
Katherine

Stefan Florin wrote:
> Hello,
>
> My Name is Stefan Florin, I've installed Greenstone and have some
> problems in managing access database files. I've created a .dbi file
> but I get an error when trying to build the Collection (I'm using the
> demo Greenstone collection). Any help will be appreciated. Thank you.
>
>
> #!c:\\strawberry\\perl\\bin\\perl.exe
> ##
> ## printenv -- demo CGI program which just prints its environment
> ##
> use POSIX;
> use strict;
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser);
> use DBI;
> use Time::Local
> print header;
>
>
>
> $dbplug\_debug=1;
>
> ######################################
> ## Set DSN-Less Connection
> ######################################
> my $DSN = 'driver=Microsoft Access Driver (*.mdb);dbq=c:\\Documents and
> Settings\\fstefan\\Greenstone2\\collect\\demo\\test.mdb';
> my $dbh = DBI->connect("dbi:ADO:$DSN", '','')
> or die "$DBI::errstr\\n";
>
> ######################################
> ## Generate the SQL Statement
> ######################################
> my $sql = qq{ SELECT * FROM tblContacts };
> my $sth = $dbh->prepare( $sql );
>
> $sth->execute() or die "Execution problem: $DBI::errstr";
>
> my( $id, $lastname, $firstname);
> $sth->bind\_columns( undef, \\$id, \\$lastname, \\$firstname);
>
> while( $sth->fetch() ) {
> print "$id, $lastname, $firstname" ."<br />";
> }
>
> %db\_to\_greenstone\_fields = (
> "firstName" => "Title",
> "lastName" => "text"
> );
>
> #######################################
> ## Close Connection
> #######################################
> $dbh->disconnect;
>
>
> ------------------------------------------------------------------------
>
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
> greenstone-devel mailing list
> greenstone-devel@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>