A long time ago, when I used ASP + ACCESS, I found that the select top SQL statement is invalid. No matter how many top SQL statements are available, the same statement is normal in SQL2000, at that time, I checked a problem about the top function in access, which had never been solved, so I was lazy to use the limitation.ProgramThe number of cycles is fixed.
Recently, I have rewritten the deep learning (ASP) URL navigation (www.deepteach.com) and carefully checked the information. It turns out that access has limited support for select top statements. If you want to use it, you must use order by after the top query statement, and the order by sorting field must be a non-repeated value, if there is a duplicate value, the top may be invalid and all records will be returned.
For example:
Select top 5 from Table order by gender. If there is a duplicate value in the "gender" field, all records may be displayed in the ACCESS database query. In this case, the top function is invalid, however, if there is no duplicate value in "gender", the top function is still effective. Therefore, to use the top function in access, check whether the order by field has duplicate values. For the sake of insurance, you can add a primary key: select top 5 from Table order by gender, ID
This problem can be prevented by using the primary key as a "non-repeating" safeguard !!
# ASP Column