袁绍伦
路人甲
路人甲
  • 注册日期2003-08-08
  • 发帖数654
  • QQ164646905
  • 铜币1336枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1337回复:0

Example in Visual Basic Using an Oracle Layer

楼主#
更多 发布于:2003-09-03 21:44
Dim LayerInfoObject As New LayerInfo
LayerInfoObject.Type = miLayerInfoTypeTab
LayerInfoObject.AddParameter "FileSpec", "c:\Program _
 Files\MapInfo\MapX 5.0\Maps\worldcap.tab"
LayerInfoObject.AddParameter "Name", "My New Layer"
Map1.Layers.Add LayerInfoObject

Example in Visual Basic Using an Oracle Layer

Dim LayerInfoObject As New LayerInfo
Dim lyr As Layer
Dim strSelection  As String
Dim l_strchris As String
Dim FoundFtrs  As MapXLib.Features

l_strchris = "Select * From ""CITY"".""STATESBOUND"""

LayerInfoObject.Type = miLayerInfoTypeServer

LayerInfoObject.AddParameter "name", "cancaps"
LayerInfoObject.AddParameter "ConnectString", "SRVR=MARILYN;UID=city;PWD=city"
LayerInfoObject.AddParameter "Query", l_strchris
LayerInfoObject.AddParameter "toolkit", "ORAINET"

LayerInfoObject.AddParameter "AutoCreateDataset", 1
LayerInfoObject.AddParameter "DatasetName", "Uscty"

Map1.Layers.Add LayerInfoObject

Set lyr = Map1.Layers.Item(1)
    strSelection = "STATE = "
        strSelection = strSelection & """"
        strSelection = strSelection & "WA"
        strSelection = strSelection & """"
  Map1.Layers.Item(1).KeyField = "State"
  Set FoundFtrs = lyr.Search(strSelection)
  MsgBox Str(FoundFtrs.Count)
  MsgBox FoundFtrs.Item(1).FeatureKey
喜欢0 评分0
愿意和大家交朋友! QQ:47559983 MSN:shaolun_yuan@hotmail.com eMail:shaolun-yuan@163.com
游客

返回顶部