如何避免eof或bof错误 [英] how to avoid either eof or bof error

查看:113
本文介绍了如何避免eof或bof错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ho to all

iam在没有数据表示EOF或BoF为真时从访问表中检索数据。如何避免这种情况。

如果IsNull(rs.Fields(0))= True那么


B = 1

Else

B = rs.Fields(0)+ 1

结束如果


如果没有数据b = 1否则我由于所有

ho to all
iam retrieving data from the access table when there is no data it saying either EOF or BoF true . how to avoid this.
If IsNull(rs.Fields(0)) = True Then

B = 1
Else
B = rs.Fields(0) + 1
End If

if there is no data b = 1 otherwise i need to increment that value B by 1
thanks to all

推荐答案

你需要先尝试检查 .RecordCount ,否则需要将该值B增加1

,在使用字段之前。
You could try checking .RecordCount first, before using the fields.


我尝试了多次记录计数,但它对我不起作用。

Rs.recordcount表示-1

是否正确
I Tried Record Count For Many Times But It Doesn''t Work For Me .
Rs.recordcount Says -1
Is It Correct


这意味着您的查询未获取任何内容。
That means your query is not fetching anything.


这篇关于如何避免eof或bof错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆