01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | Sub GetQueryLayerInfo() Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pFL As IFeatureLayer Set pFL = pMxDoc.FocusMap.Layer(0) Dim pDataset As IDataset Set pDataset = pFL Dim pQueryTableName As IQueryTableName Set pQueryTableName = pDataset.FullName Dim pQueryDescription As IQueryDescription Set pQueryDescription = pQueryTableName.QueryDescription Debug.Print pQueryTableName.Query 'クエリの変更 Dim pDatasetName As IDatasetName Set pDatasetName = pQueryTableName Dim pWorkspaceName As IWorkspaceName Set pWorkspaceName = pDatasetName.WorkspaceName Dim pPropertySet As IPropertySet Set pPropertySet = pWorkspaceName.ConnectionProperties Dim vName As Variant Dim vValue As Variant pPropertySet.GetAllProperties vName, vValue Dim i As Integer For i = 0 To pPropertySet.Count - 1 Debug.Print vName(i), vValue(i) Next i pMxDoc.ActiveView.Refresh pMxDoc.UpdateContents End Sub |
既存のクエリ レイヤーから情報を取得
2016/9/1 (木)