Software >> Development >> Languages >> Perl >> ADODB >> How to list tables in access database file

#---- CommandTypeEnum Values ----; use constant adCmdText => 0x0001; #---- CursorTypeEnum Values ----; use constant adOpenKeyset => 1; #---- LockTypeEnum Values ----; use constant adLockReadOnly => 1; use constant adSchemaTables => 20; $accessfile = "access2002.mdb"; use OLE; # use Win32::OLE $Conn = CreateObject OLE "ADODB.Connection"; $RS_Tables = CreateObject OLE "ADODB.Recordset"; $Conn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=$accessfile"); $RS_Tables = $Conn->OpenSchema(adSchemaTables); while ( !$RS_Tables->EOF ) { $table = $RS_Tables->{TABLE_NAME}->Value; if ( !($table =~ /MSys/) ) { print "table = $table\n"; } $RS_Tables->MoveNext; } $RS_Tables->Close; $Conn->Close;

Deals @yubeshop.com