首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

大家用ado开发有没有遇到这种关于adodataset1.eof有关问题

2012-02-17 
大家用ado开发有没有遇到这种关于adodataset1.eof问题关于adodataset1.eof的怎么不准呢?:我用access库来开

大家用ado开发有没有遇到这种关于adodataset1.eof问题
关于adodataset1.eof的怎么不准呢?:

我用access库来开发,有一张表:User(username,password),
其中表中有一条记录为username=test1,password=111

adodataset1.CommandText:= 'select   *   from   users   where   suser= 'test1 '   and   password= '111 ';

我在程序中这样访问:
if   not   adodataset1.eof   or   not   adodataset1.bof   then
    可以找到记录;
else
    找不到记录;

可是执行后找还是提示找不到记录,后来我反过写改为:
if   adodataset1.eof   andadodataset1.bof   then
      找不到
else
  可以找到

但还是不行
请问我这样写有错吗?要怎么样写??



[解决办法]
if (not adodataset1.eof) or (not adodataset1.bof) then //估计要括号
可以找到记录;
else
找不到记录;

其实可以这样if not adodataset1.IsEmpty then 找到了

热点排行