473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

This is an oldie but a goodie...

MLH
Has it been true in all versions of access from 1.0 forward
that if you have a table with primary key [MyID] and other
non-indexed fields [Field1], [Field2]... that using an unsorted
query to display records in that table will not necessarily
result in the dynaset being displayed in keyfield order?

Take this for example...

SELECT DISTINCTROW tblMyTable.MyID, tblMyTable.Tracked
FROM tblMyTable
WHERE ((tblMyTable.Tracked=Yes));

It may or may not display records in the order of the keyfield
[MyID]. This leads one to believe the rec's in dynaset are listed
in the order that they were entered into MyTable. Anyone
know for sure?

I have to add ORDER BY tblMyTable.MyID; if I want
the dynaset listed in ANY table's keyfield order.
Nov 13 '05 #1
3 1104
I don't guarantee this, but I think it is kind of a mix. Compacting the
database will refresh the index on the key field. After a compact, there is
a good chance that if you do no sorting yourself, that it will display in
key field order. Records added after the compact may or may not be in any
particular order. However, there is nothing that requires this to be true,
if you want something sorted, you need to tell it to sort.

--
Wayne Morgan
MS Access MVP
"MLH" <CR**@NorthState.net> wrote in message
news:tl********************************@4ax.com...
Has it been true in all versions of access from 1.0 forward
that if you have a table with primary key [MyID] and other
non-indexed fields [Field1], [Field2]... that using an unsorted
query to display records in that table will not necessarily
result in the dynaset being displayed in keyfield order?

Take this for example...

SELECT DISTINCTROW tblMyTable.MyID, tblMyTable.Tracked
FROM tblMyTable
WHERE ((tblMyTable.Tracked=Yes));

It may or may not display records in the order of the keyfield
[MyID]. This leads one to believe the rec's in dynaset are listed
in the order that they were entered into MyTable. Anyone
know for sure?

I have to add ORDER BY tblMyTable.MyID; if I want
the dynaset listed in ANY table's keyfield order.

Nov 13 '05 #2
Yes it is true that you should not expect a particular sort order unless you
specify an ORDER BY clause.

(this should be broadly true of any relational database)

--
Terry Kreft
MVP Microsoft Access
"MLH" <CR**@NorthState.net> wrote in message
news:tl********************************@4ax.com...
Has it been true in all versions of access from 1.0 forward
that if you have a table with primary key [MyID] and other
non-indexed fields [Field1], [Field2]... that using an unsorted
query to display records in that table will not necessarily
result in the dynaset being displayed in keyfield order?

Take this for example...

SELECT DISTINCTROW tblMyTable.MyID, tblMyTable.Tracked
FROM tblMyTable
WHERE ((tblMyTable.Tracked=Yes));

It may or may not display records in the order of the keyfield
[MyID]. This leads one to believe the rec's in dynaset are listed
in the order that they were entered into MyTable. Anyone
know for sure?

I have to add ORDER BY tblMyTable.MyID; if I want
the dynaset listed in ANY table's keyfield order.

Nov 13 '05 #3
MLH
You guys - thanks for clearing this up for me.
It makes sense when you think about it.

mlh
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James | last post by:
I have a from with 2 fields: Company & Name Depening which is completed, one of the following queries will be run: if($Company){ $query = "Select C* From tblsample Where ID = $Company...
5
by: Scott D | last post by:
I am trying to check and see if a field is posted or not, if not posted then assign $location which is a session variable to $location_other. If it is posted then just assign it to...
0
by: lawrence | last post by:
I've read that objects should always be passed by reference to other objects. I've also read that future versions of PHP may not support runtime passing by reference (default passing by reference...
2
by: Nick | last post by:
Can someone please tell me how to access elements from a multiple selection list? From what ive read on other posts, this is correct. I keep getting an "Undefined variable" error though... Form...
1
by: Madhusudan Singh | last post by:
<script language="Javascript1.1" type="text/javascript"> function xso_popup(url,name,options) { var cw=window.open(url,name,options); cw.opener=this; cw.focus(); } Link :
3
by: dan glenn | last post by:
I have a php page which serves up multiple pages based on how the user interacts with it - there are links on the first page that will reload (from the same php file) a new page with form fields...
5
by: Danny Anderson | last post by:
Hola- I didn't get any responses on a previous post, so I am trying to reword my problem and post compile-able code that exhibits the behavior I am describing. On the second iteration of the...
22
by: Suzie | last post by:
Hi guys, I've been coding in C for several years and I'm getting started with C++. I was given the following exercise to do and I don't quite understand it. I was wondering if any of you guys...
3
by: Motion Musso aka: Sathia | last post by:
function up(bpid) { image = document.getElementById('up_'+bpid); image.setAttribute('SRC','/templates/images/yespulse.gif') up_down('/up_down.php?bpid=' + bpid + '&action=up'); ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.