Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 171178 - Last Review: January 20, 2007 - Revision: 3.1
ACC97: Wrong Sort Order in Large, Linked SQL Server Tables
This article was previously published under Q171178
Moderate: Requires basic macro, coding, and interoperability skills.
On This Page
SYMPTOMS
Records from a linked SQL Server table are sorted incorrectly in
Microsoft Access datasheets and forms if the following conditions are
true:
- A Microsoft Access user opens a long-running query or a form based on
a long-running query.
- The query returns records ordered by one or more columns.
- The Microsoft Access user and/or other users delete records to which
the query conditions apply.
- The records are deleted before the keyset of the query is completely
built (the total number of records in the keyset is not yet displayed
at the bottom of the query window).
CAUSE
This behavior is caused by a timing issue between SQL Server and Microsoft
Access.
RESOLUTION
Although some of the records will appear out of sort order in the keyset,
they are sorted correctly on the server.
MORE INFORMATION
The following procedure requires that you to have access to a SQL Server
database containing over 100,000 records.
Steps to Reproduce Behavior
- Open a new database in Microsoft Access 97.
- Link to a SQL Server table that contains at least 100,000 records.
- Create a query based on the linked table and apply criteria that will
reduce the recordset to approximately 25,000 records. Set the sort to
Ascending for four of the columns in the query.
- Run the query.
NOTE: It is important that the query runs for a long time before all
the records are returned.
- While the query is still processing records, use the record number at
the bottom of the query window to jump to record number 8040.
NOTE: At this point the complete number of records being returned is
not yet displayed. Background processing is still fetching records.
- Start deleting records, a few at a time.
- Scroll down a few times (usually 6 or 7 times) using the scroll bar of
the query datasheet window.
Within the records you will notice that some of the records are now out
of order.
APPLIES TO
- Microsoft Access 97 Standard Edition
- Microsoft SQL Server 6.0 Standard Edition
- Microsoft SQL Server 6.5 Standard Edition
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please