阅读:1963回复:3
修改mapx实体的数据集
技术资料:修改mapx实体的数据集(tab or db)的值[转载]
当修改了某实体的数据值后,如何将修改写入它的数据集(图层或数据库),使用实体的rowvalue属性,参看下面的代码。 Dim lyr As MapXLib.Layer Dim ds As MapXLib.Dataset Dim ftrs As MapXLib.Features Dim f As MapXLib.Feature Dim rvs As MapXLib.RowValues Dim rv As MapXLib.RowValue 'Get the layer to create a dataset for Set lyr = Map1.Layers.Item("US Capitals") 'Open the dataset Set ds = Map1.Datasets.Add(miDataSetLayer, lyr) 'Get the feature to update Set ftrs = lyr.Search("capital like ""albany""") Set f = ftrs.Item(1) 'Get the row to update Set rvs = ds.RowValues(f) 'Get the column to update Set rv = rvs.Item("Capital") 'Change the value rv.Value = "New Albany" 'Update the feature and dataset with the new value f.Update True, rvs ds.Refresh |
|
1楼#
发布于:2003-12-10 19:15
谢谢
|
|
2楼#
发布于:2003-12-25 11:35
这两种方法都可以!
|
|
3楼#
发布于:2007-08-23 16:47
thank you!
|
|