This page is in the 'old' namespace, and was imported from our previous wiki. We recommend checking for more up-to-date information using the search box.

Access Processing Using DatabasePlugin

This describes my experience of getting DBPlug to get records out of MS Access database.

 $db='DBI:ADO:Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\shaoqun\Greenstone\collect\testacc\TestAccess.mdb';
 $sql_query = 'SELECT * FROM Students';
 %db_to_greenstone_fields=(
 "Name" => "Title",
 "Address" => "text",
 "StudentsID" => "Identifier",
 );

This is a mapping between column names in the Students table, and metadata names in the Greenstone archive files.

Notes about Perl modules.

Note:I couldn't find the Win32::OLE module through searching Win32::OLE at http://search.cpan.org, so I downloaded libwin32-0.26.tar.gz

 perl Makefile.PL INSTALLSITELIB="%GSDLHOME%/perllib/cpan/perl-5.8" <br/> PREFIX="%GSDLHOME%/perllib/cpan/XXX" SITEPREFIX="%GSDLHOME%/perllib/cpan" 
 nmake 
 nmake test
 nmake install

This installs the modules into %GSDLHOME%/perllib/cpan/perl-5.8 (XXX in the perl line should be set to the first component of the module name, e.g. DBI,DBD,Win32)

Note: I added

 unshift(@INC, "$ENV{'GSDLHOME'}/perllib/cpan/perl-5.8");

in the BEGIN block of Makefile.PL When installing DBD::ADO as it complained not be able to find the DBI module which was installed in %GSDLHOME%/perllib/cpan/perl-5.8

I also added that line in the BEGIN block of DBPlug.pm When building the collection