.EOF VB、VBA 用于文件结尾

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8745501/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 14:50:28  来源:igfitidea点击:

.EOF VB, VBA for End Of File

vbaado

提问by Nate Pet

Pertaining to VBA:

VBA的相关资料:

Does the following mean if a record does not exist:

如果记录不存在,以下是否意味着:

    strSQL = "Select * from tblRes  where ID = '" & Forms!Pg!PID & "'"
    rs.Open strSQL, conn, adOpenDynamic, adLockOptimistic
    If rs.EOF Then

Does rs.EOFmean that the select result did not return anything?

是否rs.EOF意味着选择结果没有返回任何内容?

回答by Matt Donnan

When working with ADO recordsets like this one then yes

当使用这样的 ADO 记录集时,是的

If rs.EOF

Will confirm there are no records, however it's worth adding that if you are working with DAO recordsets instead then you would amend to

将确认没有记录,但是值得补充的是,如果您正在使用 DAO 记录集,那么您将修改为

If rs.BOF And rs.EOF

回答by ron tornambe

Yes. EOF represents an "End Of File" condition.

是的。EOF 表示“文件结束”条件。