'假設mcnndb是個已打開某一數據庫的ado.connection '獲取數據庫中的所有表名關鍵是用到ado.connection的openschema方法 '該方法返回一個只讀的數據集,包括系統表和用戶表. '因此,需要一個集合來保存其中的用戶表 public function getalltablename() as system.collections.arraylist dim t as new system.collections.arraylist() dim rs as new adodb.recordset() rs = mcnndb.openschema(adodb.schemaenum.adschematables) do while not rs.eof if rs("table_type").value = "table" then t.add(rs("table_name").value) end if rs.movenext() if rs.eof then exit do loop rs.close() rs = nothing return t end function,歡迎訪問網頁設計愛好者web開發。