以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]在后台上面把搜索结果定位在当前表上  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=91728)

--  作者:qscwdvefb
--  发布时间:2016/10/17 21:09:00
--  [求助]在后台上面把搜索结果定位在当前表上
下面代码只能在当前表上搜索数据,定位出搜索结果

Dim dr As DataRow
dr = DataTables("T28").Find("[F390] = \'" & Forms("目录").Controls("TextBox1").value &" \'")
If dr IsNot Nothing Then
    Dim wz As Integer = Tables("T28").FindRow(dr)
    If wz >= 0 Then
        Tables("T28").Position = wz
    End If
End If

要怎么改这段代码才能让这段代码能从后台(外部数据源)的全部数据中搜出结果并且在当前表上定位出来呢?(因为我用的是分页加载加载数据,当前表只加载了部分数据)

--  作者:有点蓝
--  发布时间:2016/10/17 21:30:00
--  
Dim dr As DataRow
Dim filter As String = "[F390] = \'" & Forms("目录").Controls("TextBox1").value &"\'"
dr = DataTables("T28").Find(filter )
If dr Is Nothing Then
    Dim drs As List(of DataRow) = DataTables("T28").AppendLoad(filter)
    If drs.Count > 0 Then
        Dim wz As Integer = Tables("T28").FindRow(drs(0))
        If wz >= 0 Then
            Tables("T28").Position = wz
        End If
    End If
End If