I am using a data control with a simple SQL statement. I am accessing the Data1.Recordset.RecordCount property right after I call Data1.Refresh and I noticed it was giving me incorrect results (It would say there were 20 records, when there were actually 85). The weird part is, I put a break on the line where I try to get the record count, and when I mouse over it to see the value, it says 20, but if I wait 5-10 seconds, it changes to the correct value of 85. How would this value be changed while the program is in debug mode, on the line break? This is very confusing to me and I am unable to find any information on it.

Recommended Answers

All 3 Replies

Hi,

After refresh do some move operation like "Data1.RecordSet.MoveLast" and then check the RecordCont, it will display properly..

REgards
Veena

Thank you, a MoveLast and MoveFirst makes it work correctly, however I can't help but remain curious as to how a variable can change while program execution is halted on a breakpoint...

Hi,

Does the Table u Query Have More Records >= 1 lakh...? or u r using a Join on 2 Tables without proper link and is it returning large number of rows..?

REgards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.