ybz64
路人甲
路人甲
  • 注册日期2003-08-06
  • 发帖数128
  • QQ
  • 铜币213枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1804回复:3

修改mapx实体的数据集

楼主#
更多 发布于:2003-11-19 21:36
技术资料:修改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
喜欢0 评分0
xiaonai
路人甲
路人甲
  • 注册日期2003-11-27
  • 发帖数87
  • QQ
  • 铜币418枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2003-12-10 19:15
谢谢
举报 回复(0) 喜欢(0)     评分
echo2003
点子王
点子王
  • 注册日期2003-07-28
  • 发帖数2453
  • QQ76947571
  • 铜币5473枚
  • 威望1点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
2楼#
发布于:2003-12-25 11:35
这两种方法都可以!
举报 回复(0) 喜欢(0)     评分
tjh_pc
路人甲
路人甲
  • 注册日期2007-08-18
  • 发帖数1
  • QQ
  • 铜币105枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2007-08-23 16:47
thank you!
举报 回复(0) 喜欢(0)     评分
游客

返回顶部