asp的通用数据分页类(7)


        Dim OrderArray,i,Result,ByString,Fields,InPos
        OrderArray=Split(Value,",")   '分解每个字段值
        For i=0 To Ubound(OrderArray)
            If OrderArray(i)<>"" Then
                InPos=InStrRev(Trim(OrderArray(i))," ")  '找出排序的顺序
                If InPos<1 Then  '如果找不到则是ASC排序
                    ByString="ASC"
                    Fields=OrderArray(i)+" "
                Else
                    ByString=Trim(Mid(OrderArray(i),InPos+1))
                    Fields=Left(OrderArray(i),InPos)
                    If ByString<>"" Then
                        ByString=UCase(ByString)
                    Else
                        ByString="ASC"
                    End If
                End If
                ''转换排序
                If ByString="ASC" Then
                    ByString="DESC"
                Else
                    ByString="ASC"
                End If

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3048.html