阅读:1425回复:0
Example in Visual Basic Using an Oracle Layer
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 |
|
|