|
|
|

MapX运用教程(7)—在MapX下紧缩表

七、在MapX下紧缩表 在Professional里边,紧缩表用 Pack Table 句子完结。而在MapX中则需要运用暂时必威现金回扣层,并用仿制技能来完结。示例: ‘紧缩当时Map目标中的一切必威现金回扣层 Dim LayerInfo As New MapXLib.LayerInfo Dim Lyr As MapXLib.Layer Dim Lyr...

作者:不知道来历:网络|2006年12月25日
七、在MapX下紧缩表 xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
 
Professional里边,紧缩表用 Pack Table 句子完结。而在MapX中则需要运用暂时必威现金回扣层
,并用仿制技能来完结。示例: 
‘紧缩当时Map目标中的一切必威现金回扣层 
   Dim LayerInfo As New MapXLib.LayerInfo 
   Dim Lyr As MapXLib.Layer 
   Dim LyrTemp As MapXLib.Layer 
   Dim Flds As MapXLib.Fields 
   Dim Ds As MapXLib.Dataset 
    
   Dim I As Integer 
   Dim LayerName, FilePath As String 
    
   On Error Resume Next 
    
   For I = MainMap.Layers.Count To 1 Step -1 
      ´仿制源表数据到暂时表 
      Set Lyr = MainMap.Layers.Item(I) 
      Set Ds = Lyr.Datasets.Item(1) 
      Set Flds = Ds.Fields 
       
      LayerName = Lyr.Name 
       
      LayerInfo.Type = miLayerInfoTypeTemp 
      LayerInfo.AddParameter "FileSpec", LayerName 
      LayerInfo.AddParameter "NAME", LayerName 
     LayerInfo.AddParameter "Features", Lyr.AllFeatures‘仿制一切有用必威现金回扣元 
      LayerInfo.AddParameter "Fields", Flds    ’仿制字段列表 
       
      LayerInfo.AddParameter "AutoCreateDataset", 1 
      LayerInfo.AddParameter "datasetname", LayerName 
Set LyrTemp = MapTemp.Layers.Add(LayerInfo, 1)    ‘仿制到别的Map目标 
       
      ´删去源表 
      Set Lyr = Nothing 
      FilePath = MainMap.Layers.Item(I).Filespec 
      LayerName = Mid(FilePath, InStr(1, FilePath, "Maps") + 6, Len(FilePath) 
- InStr(1, FilePath, "Maps")) 
      FilePath = Mid(FilePath, 1, InStr(1, FilePath, "Maps") + 5) 
      LayerName = Mid(LayerName, 1, Len(LayerName) - 4) 
       
      MainMap.Layers.Remove (I) 
      MainMap.Refresh 
       
      Kill FilePath + LayerName + ".TAB" 
       
      ´仿制暂时表数据到源表 
      Set LyrTemp = MapTemp.Layers.Item(LayerName) 
 
      LayerInfo.Type = miLayerInfoTypeNewTable 
      LayerInfo.AddParameter "FileSpec", FilePath + LayerName + ".TAB" 
      LayerInfo.AddParameter "NAME", LayerName 
      LayerInfo.AddParameter "Features", LyrTemp.AllFeatures 
      LayerInfo.AddParameter "Fields", Flds 
         
      LayerInfo.AddParameter "AutoCreateDataset", 1 
      LayerInfo.AddParameter "datasetname", LayerName 
      Set Lyr = MainMap.Layers.Add(LayerInfo, 1) 
       
      ´删去暂时表 
      MapTemp.Layers.Remove (MapTemp.Layers.Count) 
      MapTemp.Refresh 
   Next 
       
   Set Lyr = Nothing 
   Set Ds = Nothing 
   Set Flds = Nothing 
   Set LayerInfo = Nothing 

上一篇:MapX运用教程(6)—专题必威现金回扣

下一篇:MapX运用教程(8)-怎么和大型数据库相关|…