Access の テーブル名を列挙する
Access の テーブル名を列挙する (ADO)
lesson003.vbs
Dim cn 'As ADODB.Connection Set cn = CreateObject("ADODB.Connection") With cn .Provider = "Microsoft.Jet.OLEDB.4.0" .ConnectionString = "Data Source=" & WScript.Arguments(0) & ";" .CursorLocation = 3 'adUseClient .Open End With Dim rs 'As ADODB.Recordset Set rs = cn.OpenSchema(20) 'adSchemaTables Do Until rs.EOF WScript.Echo rs.Fields("TABLE_NAME").Value rs.MoveNext Loop rs.Close cn.Close
実行形式
C:\>cscript c:\study\vbscript\chapter007\lesson003.vbs c:\study\vbscript\chapter
007\lesson002.mdb //nologo
IMPORT_AdventureWorksDWBuildVersion
IMPORT_DatabaseLog
IMPORT_DimAccount
IMPORT_DimCurrency
IMPORT_DimCustomer
IMPORT_DimDepartmentGroup
IMPORT_DimEmployee
IMPORT_DimGeography
IMPORT_DimOrganization
IMPORT_DimProduct
IMPORT_DimProductCategory
IMPORT_DimProductSubcategory
IMPORT_DimPromotion
IMPORT_DimReseller
IMPORT_DimSalesReason
IMPORT_DimSalesTerritory
IMPORT_DimScenario
IMPORT_DimTime
IMPORT_FactCurrencyRate
IMPORT_FactFinance
IMPORT_FactInternetSales
IMPORT_FactInternetSalesReason
IMPORT_FactResellerSales
IMPORT_FactSalesQuota
IMPORT_ProspectiveBuyer
IMPORT_save_DimAccount
IMPORT_vAssocSeqLineItems
IMPORT_vAssocSeqOrders
IMPORT_vDMPrep
IMPORT_vTargetMail
IMPORT_vTimeSeries
LINK_AdventureWorksDWBuildVersion
LINK_DatabaseLog
LINK_DimAccount
LINK_DimCurrency
LINK_DimCustomer
LINK_DimDepartmentGroup
LINK_DimEmployee
LINK_DimGeography
LINK_DimOrganization
LINK_DimProduct
LINK_DimProductCategory
LINK_DimProductSubcategory
LINK_DimPromotion
LINK_DimReseller
LINK_DimSalesReason
LINK_DimSalesTerritory
LINK_DimScenario
LINK_DimTime
LINK_FactCurrencyRate
LINK_FactFinance
LINK_FactInternetSales
LINK_FactInternetSalesReason
LINK_FactResellerSales
LINK_FactSalesQuota
LINK_ProspectiveBuyer
LINK_save_DimAccount
LINK_vAssocSeqLineItems
LINK_vAssocSeqOrders
LINK_vDMPrep
LINK_vTargetMail
LINK_vTimeSeries
MSysAccessObjects
MSysACEs
MSysObjects
MSysQueries
MSysRelationships