SQL = "SELECT * FROM adviser WHERE num=" & num
sql=sql&" order by px"
rs.Open SQL,Con,1,3
if rs.recordcount>0 then
   rs.pagesize=pagesize
   page=request("page")
   if isempty(page) then
      page=1
   end if
   page=cint(page)
   rs.absolutepage=page
   pagecount=rs.pagecount
else
   page=1
   pagecount=1
end if是不是指这个

解决方案 »

  1.   

    Dim cn As New ADODB.Connection
        Dim rs As New ADODB.Recordset
        Dim sql As String
        Dim fld As ADODB.Field    cn.ConnectionString = "Provider=MSOLAP; Datasource=LocalHost; Initial Catalog=FoodMart 2000"
        cn.Open    sql = "Select [Product:Product Name],[Measures:Store Sales] from Sales"
        set rs.ActiveConnection = cn
        rs.Open sql, cn, adOpenForwardOnly, adLockReadOnly
        MSFlexGrid1.Clear
        MSFlexGrid1.AddItem "Product" & Chr(9) & "Value"
        Do While (Not rs.EOF)
            MSFlexGrid1.AddItem rs.Fields(0).Value & Chr(9) & rs.Fields(1).Value
            rs.MoveNext ------
        Loop
      

  2.   

    Dim cmd As New ADODB.Command
    Dim rs As ADODB.Recordset    cn.Provider = "sqloledb"
    cn.Properties("Data Source") = "MyServerName"
    cn.Properties("Initial Catalog") = "pubs"
    cn.Properties("user ID") = "sa"
    cn.Properties("password") = ""
    cn.OpenCmd.CommandText = "myNextProc"
    Cmd.CommandType = adCmdStoredProcSet rs = Cmd.Execute
    While Not rs Is Nothing
        If (Not rs.EOF) Then
            Debug.Print rs(0)
        End If
        Set rs = rs.NextRecordset
    Wend
      

  3.   

    select top 100 * from (select top 200 * from table order by id dec)
    呵呵
      

  4.   

    如果你的表有自增ID就好办,查询identitycol的在某个范围的记录就是分页的结果。
      

  5.   

    如果表的字段是唯一的。,就可以用这个
    select top 100 a.* from table a where a.key not in (select top 200 b.key from table b) 
    如果字段中有重复的值用:
    select top 100 a.* from (select top 200 * from table order by id dec) a
      

  6.   

    sorry,打差错了,是这个:如果表的字段是唯一的。,就可以用这个
    select top 200 a.* from table a where a.key not in (select top 100 b.key from table b) 
    如果字段中有重复的值用:
    select top 100 a.* from (select top 200 * from table order by id dec) a