Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Tables

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-21-2007, 07:20 PM
adaniele adaniele is offline
Registered User
 
Join Date: Jul 2005
Posts: 176
adaniele is an unknown quantity at this point
i cant see a table's contents as it is

sorry for the title. i didnt know what to write.
this is the situation:

i have a form where it populates a table in access (ssmdata) from an oracle table w_ssm_data). this works perfectly.

Then the form read the hole new table in access (ssmdata) to update a specific field.

Problem:
If i open the access table (ssmdata) it is sorted by the flight fields. However, when the form reads the table in order to update the specific field the table seems to not to be sorted by the flight field.

More info:
The ssmdata table in access has many primary keys (flight, departure,arrival,caterer,frequency and aircraft).

If i take a look to the W_ssm_data table in oracle it is not sorted by flight and it is sorted in the same way the form is reading the ssmdata table in access.

example:
table in access:
flight dep arr caterer aircraft frequency
1 a b a 111 67
1 a b a 222 134
2 c s c 111 5


table in oracle:
flight dep arr caterer aircraft frequency
2 c s c 111 5
1 a b a 111 67
65 t h t 252 1


when the update step starts it reads the access table as it looks in oracle. but if i open the table in access it looks sorted by flight.

thx 4 your hlp again, max
Reply With Quote
Sponsored Links
  #2  
Old 01-21-2007, 07:27 PM
adaniele adaniele is offline
Registered User
 
Join Date: Jul 2005
Posts: 176
adaniele is an unknown quantity at this point
solved

here is the solution:
i had changed the flight primary key position. it was the last one and now is the first field in the table.
So , after the change i had done nothing else.
Now, i compacted the database and it worsk perfectly.

thx again.
max
Reply With Quote
  #3  
Old 01-22-2007, 04:33 AM
neileg's Avatar
neileg neileg is offline
AWF VIP
 
Join Date: Dec 2002
Location: Newcastle, England
Posts: 5,971
neileg has a spectacular aura aboutneileg has a spectacular aura about
As an alternative, you could base your form on a query and apply the sort order in the query.
__________________
You can't always get what you want, but if you try sometimes you may just get what you need - Rolling Stones

Cheers, Neil
Reply With Quote
  #4  
Old 01-22-2007, 07:17 AM
The_Doc_Man The_Doc_Man is online now
AWF VIP
 
Join Date: Feb 2001
Location: New Orleans, LA, USA
Posts: 6,776
The_Doc_Man is just really niceThe_Doc_Man is just really niceThe_Doc_Man is just really niceThe_Doc_Man is just really niceThe_Doc_Man is just really nice
adaniele,

What is happening is this: If a table has a primary key, it is stored AND RETRIEVED in the DB in PK order. If a table has an index but no PK, its order of storage and retrieval is not predictable. A COMPACT operation does, indeed, re-order tables with PKs.

The reason is that, absent a PK, a table has no inherent order. It is governed by set theory, which doesn't "require" order to be imposed on any given set.

It is the QUERY mechanism that imposes - or doesn't impose - order on a set of retrieved data. When you open a table, there is an implied query that contains all fields and honors the table's PK if it has one. If there is no PK, then the SELECT query does just that - it selects records that match the selection criteria. However, it performs that selection in the order in which it encounters the matching records. And there is where the order becomes less predictable. In a table without a PK and for which compaction has not yet occurred, record order is probably chronological with respect to when the table was updated to include the given record. And that order is very much not predictable for the average database.
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joining 2 tables thegooner General 1 10-25-2006 03:41 AM
Help request - VBA to copy data from one set of tables to another gellerche Modules & VBA 4 03-29-2006 12:57 AM
Relinking Tables etc Geoff Codd Modules & VBA 0 10-14-2004 09:44 AM
Linked SQL tables in Access looses key ? Romanov General 0 10-06-2004 01:48 PM
Won't display entire table's contents nate_03 Reports 3 06-18-2003 07:08 AM


All times are GMT -8. The time now is 05:34 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World