Created
December 23, 2012 18:26
-
-
Save cofearabi/4365075 to your computer and use it in GitHub Desktop.
(Perl) connect the Access mdb and display fields of the table.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl | |
use Win32::OLE; | |
$conn = "Provider=Microsoft.Jet.OLEDB.4.0;"; | |
$conn .= "Data Source=c:\\mdb\\addressbook_2007.mdb;"; | |
$db = Win32::OLE->new("ADODB.Connection"); | |
$db->Open($conn); | |
$rs = $db->Execute("SELECT * FROM アドレス帳テーブル;"); | |
while (!$rs->EOF) { | |
print $rs->{Fields}->{'漢字氏名'}->{Value},","; | |
print $rs->{Fields}->{'カナ氏名'}->{Value},"\n"; | |
$rs->MoveNext; | |
} | |
$rs->Close(); | |
$db->Close(); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment