是否有一種便攜的方式在Perl中列出*.mdb
文件 (即Microsoft Jet數據庫,也稱爲「Access數據庫」)中的表名?如何在Perl中使用DBI列出Jet數據庫的表名?
通常我用Cygwin在Windows上運行我的Perl腳本。
我可以使用DBD::ODBC
模塊在*.mdb
數據庫上運行SQL查詢,但它沒有實現DBI的table_info
函數,該函數完全符合我的需要。 DBD::ADO
和/或Win32::OLE
模塊可能可以用來代替,但他們拒絕在Cygwin下安裝,我寧願有一個可移植的解決方案 - 理想情況下,它甚至可以在Linux上工作。
的DBIx::Class::Schema::Loader
模塊可用於做到這一點,我理解它正在進行升級,它實際上在*.mdb
文件的工作,但它有,我真的不希望依賴一個巨大的列表,安裝,無論我跑我的腳本只是爲了獲得這個單一的功能。
你有沒有編寫Perl代碼列出*.mdb
文件中的表名? 你使用了哪種技術?爲什麼?
嗯,在我的情況,我得到了錯誤:'DBD :: ODBC :: db table_info失敗:[Microsoft] [ODBC Microsoft Access驅動程序]未實現的可選功能(SQL-HYC00)(...)'...但我沒有提供undef作爲前三個參數。我錯誤地解釋了錯誤消息意味着整個'table_info'函數不被支持。 – reinierpost 2011-03-07 14:42:05