如题。

解决方案 »

  1.   


    rs.open  "select * from student where  學號='aaa'"
    if not rs.eof then msgbox "已經存在"
      

  2.   

    dim strStudentNo as string
    dim cn as new adodb.connection
    dim rs as new adodb.recordset
    cn.open "..........."strStudentNo='00001'
    rs.open "select 1 from student where 学号='"& strStudentNo &"'"
    if not rs.eof then msgbox "学号" & strStudentNo &" 已经存在"
      

  3.   

    表名:student,学号字段名sid,要判断的学号是一个变量studentId,整型
    ado记录集变量名rsrs.filter = "sid = " & studentId   '设置记录集过滤条件
    if rs.bof and rs.eof then '不存在
       '具体代码
    end if
    rs.filter = ""   '恢复记录集
      

  4.   

    楼主的意思可能是已经用的SELECT 把数据从数据库中取出来了。再着某条记录两种方法:1,用 Find
       rs.find("字段 = '数值'")
       if not rs.eof then 
          存在
       end if
    2,用Filter
       rs.filter("字段 = '数值'")
       if not rs.eof then 
          存在
       end if
      

  5.   

    其实都是一样的!~~~~~~~~都是来判断rs.eof是否为True
      

  6.   

    Set rs=CreateObject("ADODB.Recrodset")rs.open "SELECT * FROM [students] WHERE [id]=学好",connStrif not rs.eof then
      '存在
    else
      '不存在
    end if
      

  7.   

    rs.open  "select count(*) from student where  學號='aaa'"
    if not rs.eof then
       if rs(0) =0 then
       else   endif
    endif