Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

You can also try Win32::OLE + native DAO and/or ADO objects and methods

by bdimych (Monk)
on Dec 06, 2007 at 15:03 UTC ( #655428=note: print w/replies, xml ) Need Help??


in reply to Obtaining List of tables from ms access database

not tested, just principles
my $dao = Win32::OLE->new('DAO.DBEngine.36'); my $db = $dao->OpenDatabase("access_database.mdb"); my $tables = $db->TableDefs; for (my $i = 0; $i < $tables->{Count}; $i++) { print $tables->Item($i)->{Name}, "\n"; } ......... see c:\Program Files\Common Files\Microsoft Shared\OFFICE11\1049\DAO360.CH +M my $ado = Win32::OLE->new('ADODB.Connection'); $ado->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=access_databa +se.mdb"); my $recordset = $ado->OpenSchema(20); # 20 is adSchemaTables until ($recordset->{EOF}) { print $recordset->{Fields}->Item('TABLE_NAME'), "\n"; $recordset->MoveNext; } ......... $recordset = $ado->Execute("SELECT ... FROM ... WHERE ...")->GetRows() +; print $recordset->[0]->[0], "\n"; ......... see c:\Program Files\Common Files\Microsoft Shared\OFFICE11\1049\ADO210.CH +M and c:\Program Files\Common Files\Microsoft Shared\OFFICE11\1049\JETSQL40. +CHM and also see MS Access application objects model c:\Program Files\Microsoft Office\OFFICE11\1049\VBAAC10.CHM
  • Comment on You can also try Win32::OLE + native DAO and/or ADO objects and methods
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://655428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2023-09-23 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?