阅读:1389回复:3
mo显示Tip时发生错误
<DIV><FONT face=Verdana><FONT size=2>使用VB+Mo,动态加载SDE库后,在map上移动鼠标时,一直提示ActiveX部件不能创建</FONT></DIV>
<DIV><FONT size=2><FONT size=3>" If tpRec Is Nothing Then Exit Sub" 出错</FONT></FONT></DIV> <DIV><FONT size=2><FONT size=3>希望能得到您的指点,谢谢</FONT><BR></DIV></FONT> <DIV><FONT size=2></FONT> </DIV> <DIV> Dim Lyr As MapObjects2.MapLayer<BR> Dim tpRec As New MapObjects2.Recordset<BR> Dim tpStr As String<BR> Dim Mypoint As New MapObjects2.Point<BR> Dim keyFieldName As String<BR> <BR>' Set Mypoint = New MapObjects2.Point<BR> If CmbMapLayer.Text = "选择图层名称" Or CmbMapLayer.Text = "" Then<BR> Exit Sub<BR> End If<BR> <BR> '得到当前图层的关键字段<BR> Dim rs As New ADODB.Recordset<BR> Set rs = gAdoCon.Execute("Select * From DictLayer Where LayerDisplayName='" ; CmbMapLayer.Text ; "'")<BR><BR> <BR> Set Mypoint = mapDisp.ToMapPoint(X, Y)<BR> Set Lyr = Me.mapDisp.Layers(0)<BR> <BR> If Lyr Is Nothing Then<BR> Exit Sub<BR> End If</DIV> <DIV> </DIV> <DIV><BR> Set tpRec = Lyr.SearchByDistance(Mypoint, 100, "")<BR> <BR> If tpRec Is Nothing Then Exit Sub<BR> If Not tpRec.EOF Then</DIV> <DIV> </DIV> <DIV> tpStr = ""<BR> Do While Not tpRec.EOF<BR> tpStr = tpRec.Fields("name").Value</DIV> <DIV> </DIV> <DIV> tpRec.MoveNext<BR> Loop<BR> End If '<BR> <BR> map.ToolTipText = tpStr<BR></DIV></FONT> |
|
1楼#
发布于:2007-03-21 17:15
<img src="images/post/smile/dvbbs/em01.gif" /><img src="images/post/smile/dvbbs/em02.gif" />
|
|
2楼#
发布于:2007-03-21 17:36
<img src="images/post/smile/dvbbs/em02.gif" />
|
|
3楼#
发布于:2007-03-22 16:55
晕哟!代码没问题,是图层出了问题
|
|