[greenstone-devel] Question

From Stefan Florin
DateWed Dec 17 22:39:20 2008
Subject [greenstone-devel] Question
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:strawberryperlbinperl.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
SettingsfstefanGreenstone2collectdemo est.mdb';
my $dbh = DBI->connect("dbi:ADO:$DSN", '','')
or die "$DBI::errstr ";

######################################
## 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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://list.scms.waikato.ac.nz/mailman/private/greenstone-devel/attachments/20081217/3ea13313/attachment.html