|
阅读:941回复:0
求助
<P>本人用VB+MAPX做毕业设计,范围查询代码如下:</P>
<P>Dim i As Integer<BR> i = searchResultsList.ListIndex<BR> Dim id As String<BR> <BR> WhereID = "select * from xjh1 where MAPINFOID in ('"<BR> For j = 0 To searchResultsList.ListCount - 1<BR> id = searchResultsList.List(j)<BR> If j <= searchResultsList.ListCount - 2 Then<BR> WhereID = WhereID + id + "','"<BR> End If<BR> If j = searchResultsList.ListCount - 1 Then<BR> WhereID = WhereID + id + "')"<BR> End If<BR> <BR> Next<BR> <BR> id = searchResultsList.List(i)</P> <P> strSQL = WhereID<BR> <BR> <BR> <BR> If searchResultsList.ListCount > 0 Then<BR> <BR> test_ado.RecordSource = strSQL<BR> test_ado.Refresh<BR> Else<BR> MsgBox ("对不起,没有你没有选择有效的地点!")<BR> <BR> End If<BR>End Sub<BR>可是查询时总是有错误,望达人解答下</P> |
|