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