对ArcSDE Geodatabse进行反注册

Public Function DataSet_Unregister(ByRef pGISDataset As Idataset) As String
 Dim pEnumDataSet As IEnumDataset
 Dim pDataSet As Idataset
 Dim pVersionedObject As IVersionedObject

On Error GoTo errHandle:

 DataSet_Unregister = "" '过程错误标志 ""正确,"F"错误

 If Not pGISDataset Is Nothing Then
  Set pVersionedObject = pGISDataset
  If pVersionedObject.IsRegisteredAsVersioned Then
   Debug.Print "GIS图层正在取消注册版本"
   pVersionedObject.RegisterAsVersioned False
   Debug.Print "GIS图层取消注册成功"
  Else
Debug.Print "GIS图层已经未注册状态"
  End If
  Set pVersionedObject = Nothing
 End If

 Exit Function

errHandle:
 If Err.Number > 0 Then
  DataSet_Unregister = "F"
  MsgBox Err.Description, vbInformation, "错误提示"
 Else
  DataSet_Unregister = "F"
  MsgBox "取消版本注册失败" & vbCr & vbCr & _
  Err.Description, vbInformation, "错误提示"
 End If
End Function

(提示:Unregister必须使用该数据的创建用户进行操作)



http://www.gispark.com/html/develop/2006/0707/24.html

你可能感兴趣的:(Data)