sorting problem

  • Thread starter Thread starter Patrick Maurer
  • Start date Start date
P

Patrick Maurer

Hello,

I connect an access database from a win32 application.

My table (tabProducts) looks like that:

1. Id Text(38) Used to store Guids
2. Name Text(50)
3-n several integer fields

The Id-Field is the primary key in this table.

So how can i guarantee, that the records in this table will be retrieved, in
that order, in which they have been created. I do not have a timestamp-field
with a creation date, to use an order by clause.

When I use this query:

SELECT * FROM tabProducts;

the records are not always retrieved in the save order.

Could you please help me?

Thanks
Patrick Maurer
 
Patrick said:
Hello,

I connect an access database from a win32 application.

My table (tabProducts) looks like that:

1. Id Text(38) Used to store Guids
2. Name Text(50)
3-n several integer fields

The Id-Field is the primary key in this table.

So how can i guarantee, that the records in this table will be
retrieved, in that order, in which they have been created.

You don't. Access like most databases does not store data in an "order"
is is more of a bucket of data.

If you want display by some order, you need to provide the order. Note:
Autonumber is not designed for that, as it is only designed to provide
unique numbers.
 
Sorry, Patrick, I'm afraid you're out of luck. The only reliable way to
guarantee any specific order is to specify it in the ORDER BY clause of the
query, and of course to do that you must have a field or combination of
fields on which to sort. If the order of entry is important, you must add a
field to track it. Without such a field, the order of entry is unknown.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top