数据库连接测试成功。
我使用
Adodc1.RecordSource = "select admin_name  from admin where admin_name='" & txtUserName.Text & " '"if adodc1.recordset.recordcount=0 then但是提示信息为
实时错误 ‘91’
对象变量或with块变量未设置在if adodc1.recordset.recordcount=0 then   前面加上Adodc1.Refresh  就可以通过了。

解决方案 »

  1.   

    也可以用 if adodc1.recordset.eof=true then   ^_^
      

  2.   

    wangtiecheng(不知不为过,不学就是错!) ( ) 信誉:100    Blog  2006-11-16 12:55:27  得分: 0  
     
    你好摊哦,我是解决了,然后公布出来,让不知道的朋友看看,到时候要也出了这问题,就好办了。
      

  3.   

    现在在做添加用户框   也是用adodc控件  
      Adodc2.RecordSource = "insert into 操作员(操作员名,操作员密码) values ('" & txtname1.Text & "','" & txtpwd4.Text & "')"
       
      Adodc2.Refresh
      
      If Adodc2.Recordset.RecordCount = 0 Then
    这时ADODC1(登陆框使用的控件名称)报  对象关闭时 不允许操作   怎么能打开ADODC1控件?
      

  4.   

    感觉你是在警告没有查找到记录吧:
    if adodc1.recordset.recordcount=0 then这句我觉得没有错误,但是是不是把客户游标什么的加进去了?
    或者if adodc1.recordset.recordcount.Eof=TRUE then  msgbox"jhdjsh"
    一点意见  仅供参考啊!