How can we determine whether the number of records in the adoquery dataset is null, that is, whether there is data in the dataset? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061221094018194.html
RT
Adoquery. open;
If adoquery. EOF then
Data is empty
Adoquery1.open;
If adoquery1.isempty then
Adoquery1.open;
If adoquery1.recordcount <= 0 then data is empty
Adoquery1.open;
If adoquery1.isempty then
Positive Solution
Recordcount cannot be used as the judgment condition.
If adoquery. EOF then
And
If adoquery1.isempty then
Which of the two is better?
If adoquery1.isempty then is more advanced and will not cause errors. It does not depend on other States, as long as adoquery1 is enabled. The empty pair is empty. The link is empty.
Adoquery. open;
// If an operation is performed in the afteropen event, the judgment may be inaccurate.
If adoquery. EOF then
1. Whether adoquery1.recordcount is 0
2. Whether adoquery1.isempty is true
3 if adoquery. bof = adoquery. EOF then is not recorded
Else!