Understanding of database objrs. eof

Source: Internet
Author: User
I took it for granted when I was doing database today! It took an hour to solve the problem. The premise is that when I check a column in the database, I confuse the query column with a known column. I think that no matter which column I enter, this objrs will exist in the database. eof won't be true, and the result cannot be taken for granted! Understanding of objRs. EOF:

I took it for granted when I was doing database today! It took an hour to solve the problem. The premise is that when I check a column in the database, I confuse the query column with a known column. I think that no matter which column I enter, this objrs will exist in the database. eof won't be true, and the result cannot be taken for granted! Understanding of objRs. EOF:

I took it for granted when I was doing database today! It took an hour to solve the problem.

The premise is that when I check a column in the database, I confuse the query column with a known column. I think that no matter which column I enter, this objrs will exist in the database. eof won't be true, and the result cannot be taken for granted!

Understanding of objRs. EOF:

Determines whether the result set is empty. The program will judge based on the known columns you give, rather than the columns to be queried.

For example, the query statement is: strSQL = "SELECT password, identity FROM system user WHERE UserName = '" & UserName &"'"

Enter an account in the account box. If this account exists in the Database, objrs. eof is false; otherwise, it is true.

However, if I enter the columns in the database in the password and identity, as follows:

The result is that objrs. eof is true. The user does not exist.

Interesting!

Lesson: Do not take questions for granted! You are not the result, but the fact is the result!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.