以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  数据筛选  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=52665)

--  作者:qianqian1530
--  发布时间:2014/6/19 23:35:00
--  数据筛选

Tables("YAHOO_data").Filter = "path = \'家具:ソファ?座椅子\'" \'查询数据
If Tables("YAHOO_data").rows.count > 0 Then
    Dim A1_B1 As Integer = Tables("YAHOO_data").rows.count
    Dim A1_B2 As String = ""
    Dim A1_B3 As Integer = 0
    Dim A1_B4 As Integer
    For A1_B4 = 0 To A1_B1 - 1
        Dim temp As Integer = Rand.Next(A1_B1)
        If ("," & A1_B2).Contains("," & temp & ",") = False Then
            A1_B2 &= temp & ","
            A1_B3 += 1
            If A1_B3 =  4 Then
                Exit For
            End If
        End If
    Next
    Tables("YAHOO_data").filter = "_Identify in (" & A1_B2.TrimEnd(",") & ")"
    Tables("网页生成器").Value(11,2) =""
    Dim A1_B5 As Integer = 0
    For Each rw As Row In Tables("YAHOO_data").Rows
        A1_B5+ =1
        Dim A1_B6 As Integer
        A1_B6 = rw("price")
        Tables("网页生成器").Value(11,2)+ = "<li class=\'fore" & A1_B5 & "\'><b class=\'pi pix1\'>新品</b><div class=\'p-img\'><a target=\'_blank\'href=\'http://teststr.shopping.yahoo.co.jp/tkmall/" &  rw("code").ToLower() & ".html\'title=\'" & rw("name") & "\'><img width=\'160\'height=\'160\'src=""http://shopping.geocities.jp/tkmall/img/" &  rw("code").ToLower() & ".jpg""alt=\'" & rw("name") & "\'></a></div><div class=\'p-name\'style=\'height: 3em;\'><a href=\'http://teststr.shopping.yahoo.co.jp/tkmall/" &  rw("code").ToLower() & ".html\'target=\'_blank\'title=\'" & rw("name") & "\'>" & rw("name") & "</a></div><div class=\'p-price\'>TK価:<strong>¥" & Format(A1_B6,"#,###") & "</strong>円(税込)</div></li>"
    Next
    Tables("YAHOO_data").Filter = ""
Else
    msgbox("没有找到你需要的数据1")
End If



 亲, 我想的是,  显筛选 关键字, 然后在 从 筛选的结果里,  随机 4个数据..

 可是 当 代码 执行到  粉色 那里是,  他会重新筛选数据... 而不是  在已经筛选的数据里筛选...

有什么办法解决么?

图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2014/6/20 8:27:00
--  
Tables("YAHOO_data").filter = Tables("YAHOO_data").filter & " and (_Identify in (" & A1_B2.TrimEnd(",") & ")"
--  作者:qianqian1530
--  发布时间:2014/6/20 9:39:00
--  回复:(Bin)Tables("YAHOO_data").filter = Tables(...
表达式 不对...


表达式缺少右括号。

--  作者:Bin
--  发布时间:2014/6/20 9:39:00
--  
Tables("YAHOO_data").filter = Tables("YAHOO_data").filter & " and _Identify in (" & A1_B2.TrimEnd(",") & ")"

--  作者:qianqian1530
--  发布时间:2014/6/20 10:04:00
--  回复:(Bin)Tables("YAHOO_data").filter = Ta...
还是不行啊, 亲。

Tables("YAHOO_data").filter = Tables("YAHOO_data").filter & " and  _Identify in (" & A1_B2.TrimEnd(",") & ")"

第二次筛选的时候,      A1_B2.TrimEnd(",")    随机后,     _Identify  不存在的话,还是不能显示数据..



我想要的效果是, 在整个表里 筛选 关键字, 在筛选后的数据里, 随机 4个行 ...


图片点击可在新窗口打开查看图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2014/6/20 10:09:00
--  
 Tables("YAHOO_data").Filter = "path = \'家具:????座椅子\'" \'查询数据
If Tables("YAHOO_data").rows.count > 0 Then
    Dim A1_B1 As Integer = Tables("YAHOO_data").rows.count
    Dim A1_B2 As String = ""
    Dim A1_B3 As Integer = 0
    Dim A1_B4 As Integer
    For A1_B4 = 0 To A1_B1 - 1
        Dim temp As Integer = Rand.Next(A1_B1)
        If ("," & A1_B2).Contains("," & temp & ",") = False Then
            A1_B2 &= Tables("YAHOO_data").Rows(temp)("_Identify") & ","
            A1_B3 += 1
            If A1_B3 =  4 Then
                Exit For
            End If
        End If
    Next
    Tables("YAHOO_data").filter = "_Identify in (" & A1_B2.TrimEnd(",") & ")"
    Tables("网页生成器").Value(11,2) =""
    Dim A1_B5 As Integer = 0
    For Each rw As Row In Tables("YAHOO_data").Rows
        A1_B5+ =1
        Dim A1_B6 As Integer
        A1_B6 = rw("price")
        Tables("网页生成器").Value(11,2)+ = "<li class=\'fore" & A1_B5 & "\'><b class=\'pi pix1\'>新品</b><div class=\'p-img\'><a target=\'_blank\'href=\'http://teststr.shopping.yahoo.co.jp/tkmall/" &  rw("code").ToLower() & ".html\'title=\'" & rw("name") & "\'><img width=\'160\'height=\'160\'src=""http://shopping.geocities.jp/tkmall/img/" &  rw("code").ToLower() & ".jpg""alt=\'" & rw("name") & "\'></a></div><div class=\'p-name\'style=\'height: 3em;\'><a href=\'http://teststr.shopping.yahoo.co.jp/tkmall/" &  rw("code").ToLower() & ".html\'target=\'_blank\'title=\'" & rw("name") & "\'>" & rw("name") & "</a></div><div class=\'p-price\'>TK価:<strong>¥" & Format(A1_B6,"#,###") & "</strong>円(税込)</div></li>"
    Next
    Tables("YAHOO_data").Filter = ""
Else
    msgbox("没有找到你需要的数据1")
End If