X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Small Issue Between Access And SQL Server, Access 2016    
post Apr 28 2020, 02:36 PM

Posts: 779
Joined: 7-May 11

Using SQL Server as a backend for my Access database.

My linked SQL Server tables seem to get sorted my Access so they do not display in the same way. Notice that in Access the table does not appear with the PK column in the same order as in SQL Server

Attached File  Untitled_picture1.png ( 25.72K )Number of downloads: 4

SQL Server
Attached File  Untitled_picture2.png ( 70.74K )Number of downloads: 2
Go to the top of the page
Start new topic
post Apr 28 2020, 03:44 PM

UA Admin
Posts: 37,457
Joined: 20-June 02
From: Newcastle, WA

As theDBGuy pointed out, tables do not have any intrinsic sort order. When you retrieve a recordset for DISPLAY, as is the case when you open a DataSheet View of the table, the records need to be sort "somehow" and the most common default sort order is by Primary Key value, but that is in no way to be considered "the proper way", it's just a convenient default.

Access allows you to sort records in a table and then save that sort order with the table. When you reopen the datasheet view again, that saved sort order gets applied. I suspect, in fact, that that is what has happened to cause your Access table to appear to be sorted differently.

Attached File  sortondatasheetview.png ( 10.16K )Number of downloads: 0

No worries on any of this. If you do need a recordset to be presented in a specific sort order, the way to do that is to use a query and include the Order By clause in that query.
This post has been edited by GroverParkGeorge: Apr 28 2020, 03:58 PM

My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    5th July 2020 - 10:30 PM