CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
How to to read MS-Access DB Table to a text file???

 



niyas.mohd
New User

Mar 15, 2009, 9:59 PM

Post #1 of 5 (5315 views)
How to to read MS-Access DB Table to a text file??? Can't Post

Hi Team,

I have requirement to read a table and dump into a CSV file. The DB that i am using MS-Access DB.

Can you guys please give me some pointers?

Regards

Mohamed Niyas


FishMonger
Veteran / Moderator

Mar 16, 2009, 4:50 AM

Post #2 of 5 (5304 views)
Re: [niyas.mohd] How to to read MS-Access DB Table to a text file??? [In reply to] Can't Post

You'll need the DBI (Database Interface) module and DBD::ODBC (ODBC database driver).

http://search.cpan.org/~timb/DBI-1.607/DBI.pm

http://search.cpan.org/~mjevans/DBD-ODBC-1.18/ODBC.pm


1arryb
User

Mar 16, 2009, 11:06 AM

Post #3 of 5 (5299 views)
Re: [FishMonger] How to to read MS-Access DB Table to a text file??? [In reply to] Can't Post

Perl monks has a good thread that shows the DBI way and also points to some specialized MS Access conversion tools http://www.perlmonks.org/?node_id=474068

Cheers,

Larry


niyas.mohd
New User

Mar 19, 2009, 9:02 AM

Post #4 of 5 (4919 views)
Re: [1arryb] How to to read MS-Access DB Table to a text file??? [In reply to] Can't Post

Hi guys,

Thanks a lot for your help. The access link was quiet useful. I am very new to perl. so just finding some difficulties while installing the modules. As of now my PPM says that DBI.PM installed. But while running the following code to know the drivers details, I am facing a error that perl can not locate the DBI.PM file.

Code:

use strict;

use DBI;
use DBI qw(:sql_types); # Can be used in where clause in case of search with types

# The below code shows the list of database drivers
# in perl along with the version

my @driver_names = DBI->available_drivers;
foreach my $drv (@driver_names)
{
print "$drv\n";
}

--------------------

Error:

Can't locate DBI.pm in @INC (@INC contains:

Can any one throw some light on this issue?

Note: I have included the lib path in the PATH variable too.

Regards

Mohamed Niyas M


1arryb
User

Mar 19, 2009, 9:12 AM

Post #5 of 5 (4915 views)
Re: [niyas.mohd] How to to read MS-Access DB Table to a text file??? [In reply to] Can't Post

Hi niyas,

Is that the whole error message returned by Perl? It would be very suspicious if '(@INC contains:' ... NOTHING! It should at least return the installed perl library path. For example, on one of my machines:

Code
$ perl -e 'print "@INC\n";'

returns:

Code
/usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0  
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.10.0
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib/perl5/vendor_perl
/usr/local/lib/perl5/site_perl/5.10.0
/usr/local/lib/perl/site_perl
/usr/lib/perl5/site_perl .


Cheers,

Larry

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives