Welcome to the Monastery | |
PerlMonks |
How to get table names using DBI (was Re: changing read permissions on MS ACCESS database)by bmann (Priest) |
on Jul 14, 2005 at 19:37 UTC ( [id://475026]=note: print w/replies, xml ) | Need Help?? |
Hi chicago928, If I read your question(s) right, what you are looking for is a generic way to get a list of table names (and column names) from an access database so you can dump each table to a csv file, right? There are several ways you can get this info without changing permissions on a db's system tables. One way is to use the DBI's table_info method. Access system tables (MSys*) have a type of "SYSTEM TABLE", regular tables have type "TABLE", and queries have type "VIEW". The fourth parameter to table_info allows you to filter the results, and I chose to display only the regular tables. This all assumes you are on Win32. You can find more info on table_info and col_info at DBI. You might also be interested in DBI recipes.
In Section
Seekers of Perl Wisdom
|
|