Hello TompIfe,
Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou
[MSFT] and I will be working on this issue with you. After reading your
post carefully, I do the following test and research on my side:
I have created a simple access database which has a table and a query of
the table in it. There are 40,000 rows in the query. I use the exactly
same
codes you post to get the row count of query. But it returns the correct
count number.
This issue is not a general one and I do not find a similar report before.
To work the issue out, it needs both our sides' efforts. So it is
necessary
for us to collect some information to troubleshoot.
Here are some points we need to clarify at the moment:
1.What is the version of Access and have you applied the newest services
pack of Office products. I test on Access 2003 SP3 and Access 2007 SP1,
and
the row count always returns correctly.
2.How is the query expws3 created? Is it generated from several tables and
some complicated relationships? If the expws3's creating is not supposed
to
be discussed in public, please feel free to send me emails about this
information to (e-mail address removed). After getting the info of expws3, I
will try again to reproduce the symptom according to the definition of the
query.
3.After the expw3 is created, have we modified any based table's
structure?
I ask this question because a similar issue in SQL Server was reported.
That issue resulted from the DataView's Schema was not updated after its
based table's schema was modified.
4.If you can provide the reproducible Access database and sent it to me,
that will be helpful for us to have a clearer picture of the issue.
I know there are many questions asked in a time, but they are needed to
narrow down the problem. Thanks for your understanding on this.
Also, here are some suggestions you can try on your side:
1.Make sure the Access file is saved before we use the code to retrieve
data from Access database. The retrieved data will not be updated one
unless we save the Access database file.
2.Execute the sql command "Select * from expws3" with test.ExecuteReader()
and use a loop to find how many rows exist in the returned reader. Codes
look like:
OleDbCommand test = con.CreateCommand();
test.CommandText = "Select * from expws3";
con.Open();
int count = 0;
OleDbDataReader reader = test.ExecuteReader();
while (reader.Read())
{
count++;
}
Debug.Print(count.ToString());
con.Close();
3. Duplicate the current db's schema to a new access db. Input a small
number of rows into it for test, and see whether the query works correctly
when the row count is small.
Best regards,
Ji Zhou (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.