Getting all names in mdb

Hello,

I'm using .mdb file with DBI/DBD::ODBC.

my $dbh = DBI->connect("dbi:ODBC:test", "", "",
{RaiseError => 1, AutoCommit => 0, LongReadLen => 409600})
or die "$DBI::errstr";

Anyone will teach me how to get all names of tables
(in test.mdb)?

Regards,
Hirosi Taguti
h-taguchi [ Fr, 07 Dezember 2007 03:19 ] [ ID #1888317 ]

Re: Getting all names in mdb

Did you try $dbh->table_info()?
(http://search.cpan.org/~timb/DBI-1.601/DBI.pm#table_info)
If yes, what was the problem?

Alexander

On 07.12.2007 03:19, $BED8}(B $B9 [at] (B wrote:
> Hello,
>
> I'm using .mdb file with DBI/DBD::ODBC.
>
> my $dbh = DBI->connect("dbi:ODBC:test", "", "",
> {RaiseError => 1, AutoCommit => 0, LongReadLen => 409600})
> or die "$DBI::errstr";
>
> Anyone will teach me how to get all names of tables
> (in test.mdb)?
>
> Regards,
> Hirosi Taguti
>


--
Alexander Foken
mailto:alexander [at] foken.de http://www.foken.de/alexander/
Alexander [ Fr, 07 Dezember 2007 08:17 ] [ ID #1888318 ]

Re: Getting all names in mdb

Hi. Long time to see you :-).

----- Original Message -----
>Subject: Getting all names in mdb
>Date: Fri, 7 Dec 2007 11:19:05 +0900
>From: $BED8}(J $B9 [at] (J <h-taguchi [at] secom.co.jp>
>To: <dbi-users [at] perl.org>
>
>
>Hello,
>
>I'm using .mdb file with DBI/DBD::ODBC.
>
>my $dbh = DBI->connect("dbi:ODBC:test", "", "",
> {RaiseError => 1, AutoCommit => 0, LongReadLen => 409600})
> or die "$DBI::errstr";
>
>Anyone will teach me how to get all names of tables
>(in test.mdb)?
If you want to use ODBC, you can get them from "MSysObjects" table.
But probably you should set reading previledges for that mdb files.

cf. Sorry these are in Japanese
http://www.accessclub.jp/bbs6/0003/das426.html
http://homepage1.nifty.com/kojama/works/rdbms/jet/dbinfo.htm l#term04
http://www.nihon-eng.co.jp/c-break/technote/tomcat/TCAT41_DB .htm

# I've set them with Security Wizard

ex.
use strict;
use DBI;
my $sDsn = 'driver=Microsoft Access Driver (*.mdb);dbq=c:\test.mdb;'.
'SystemDB=c:\security.mdw';
my $hDb = DBI->connect('dbi:ODBC:'. $sDsn, 'dbdtest', 'dbdtest',
{RaiseError=>1, AutoCommit=> 1});
my $hSt = $hDb->prepare(
q{SELECT name FROM MSysObjects WHERE type=1 AND name NOT LIKE 'MSys%'}
);
$hSt->execute();
while(my $raD = $hSt->fetchrow_arrayref())
{
print join("\t", [at] $raD) . "\n";
}
$hSt->finish();
$hDb->disconnect();
gcd00051 [ Fr, 07 Dezember 2007 09:51 ] [ ID #1888319 ]

RE: Getting all names in mdb

Hiroshi,

What names are you looking for? Column names?

Peter

-----Original Message-----
From: $BED8}(J $B9 [at] (J [mailto:h-taguchi [at] secom.co.jp]
Sent: Thursday, December 06, 2007 7:19 PM
To: dbi-users [at] perl.org
Subject: Getting all names in mdb

Hello,

I'm using .mdb file with DBI/DBD::ODBC.

my $dbh = DBI->connect("dbi:ODBC:test", "", "",
{RaiseError => 1, AutoCommit => 0, LongReadLen => 409600})
or die "$DBI::errstr";

Anyone will teach me how to get all names of tables (in test.mdb)?

Regards,
Hirosi Taguti


This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message.
Peter.Loo [ Fr, 07 Dezember 2007 17:54 ] [ ID #1888321 ]
Perl » perl.dbi.users » Getting all names in mdb

Vorheriges Thema: DBI problem...
Nächstes Thema: Connecting to Database