gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
阅读:3777回复:4

arcsde中的数据编辑问题

楼主#
更多 发布于:2003-07-26 00:13
不要在arcsde中注册你的layer,在mo中无法编辑已经注册的层.
用一些参数连接sde,你就可以进行编辑

Dim moConSDE As New MapObjects2.DataConnection
moConSDE.Server = "SDE80:papagaio" 'server name
moConSDE.Database = "instance=port:5151" 'SDE
'service, connecting by Oracle
moConSDE.User = "XXX" 'user name with permission
'to access your layer
moConSDE.Password = "XXX" 'password
moConSDE.Connect

得到一个图层:
Dim moLy as New MapObjects2.MapLayer
Dim strLyName as string
'AAA is the owner of the layer
'AL is the name of the layer
'Points is the shapetype
strLyName = "AAA.AL.SHAPE.Points"
Set moLy.GeoDataset= moConSDE.FindGeoDataset(strLyName)

添加新的记录:
Dim moRecs as New MapObjects2.Recordset
Dim moPt as New MapObjects2.Point
Set moRecs = moLy.Records
Set moRecs = moLyMerc.Records
moRecs.StartTransaction
moRecs.AddNew
moRecs("shape").Value = moPt
moRecs.Update
moRecs.CommitTransaction
moRecs.StopEditing

删除当前记录:
moRecs.StartTransaction
moRecs.Edit
moRecs.Delete
moRecs.Update
moRecs.CommitTransaction
moRecs.StopEditing

修改当前的记录:
moRecs.StartTransaction
moRecs.Edit
moRecs("name").Value = "test"
moRecs.Update
moRecs.CommitTransaction
moRecs.StopEditing

88..

喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2003-09-01 09:55
听说用c api的方法可以增加sde图层,so 麻烦,没做过,现在改用ao做电力,兄弟们加油!
举报 回复(0) 喜欢(0)     评分
游客

返回顶部