adoRs.open "select count(*) as RowCount from tabel"
if adoRs.fields("RowCount")=0 then
     'no datas
end if

解决方案 »

  1.   

    dao:
    dim sc as recordset
    if sc.RecordCount =0 then
      '没有数据
    endif
    ado:
    dim sc as ado.recordset
    if sc.eof and sc.bof then
      '没有数据
    end if
      

  2.   

    sql = "select * from table"
    set rs = Server.CreateObject("Adodb.RecordSet")
    rs.CursorLocation = adUseClient
    rs.open sql,conn,3
    if rs.recordcount<1 then 
    '空
    else
    while not rs.eof
    '
    '
    '
    rs.MoveNext
    wend
    rs.close
    end if