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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> 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
post Apr 28 2020, 02:50 PM

UA Moderator
Posts: 78,457
Joined: 19-June 07
From: SunnySandyEggo

Hi. Just one person's humble opinion, but that shouldn't matter. If you want to sort the records, you could use a query. Either that or just click the sort button on the datasheet (I guess). Cheers!

Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
post Apr 28 2020, 03:43 PM

UtterAccess VIP
Posts: 12,379
Joined: 10-February 04
From: South Charleston, WV

You must sort tables or expect any sorted order.

Robert Crouser
Go to the top of the page
post Apr 28 2020, 03:44 PM

UA Admin
Posts: 37,463
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

Custom Search

RSSSearch   Top   Lo-Fi    6th July 2020 - 02:57 PM