SdeConnect: Failed to connect. Connection error: #-102  是什么错误?

解决方案 »

  1.   

    Dim oConnection As New MapObjects2.DataConnection
     Screen.MousePointer = vbHourglass
      
      ' update the values for Server, Database, and Password
      ' for your particular SDE connection
      With oConnection
        .Server = "sde81:192.168.0.157" '"serverX"
        .User = "SDE"
        .Password = "sde" '"passwd"
        .Database = "sde" '"DatabaseX"
        
        If oConnection.Connect Then    ' put the names of the sde layers into the listbox      List1.Clear
          For Each oGeoDataset In .GeoDatasets
            List1.AddItem oGeoDataset.Name
          Next oGeoDataset
        Else
          MsgBox "SdeConnect: Failed to connect. Connection error: #" & .ConnectError
        End If
      
      End With
      Screen.MousePointer = vbDefault
      

  2.   

    改一下Database试试.Database = "instance=sde"