Import/Export Headache

H

Howard

I import/export txt files using MS Access 2000
acImport/acExport. When the text file was imported into an
Access table, I (SOMETIMES, BUT NOT ALWAYS) find that the
data sort order has been changed in the table.

For example, the sort order in the original text file is:

A
B
C
..
..
Z

After imported into the table, the sort order becomes:

C
A
Z
..
..
D

Same situation happens to the case of exporting from
Access table to a .txt file.

Why does it happen? How to avoid? Please help.

Thanks in advance.

Howard
 
R

Roger Carlson

The thing you must realize is that there is NO intrinsic sort order to an
Access table. It may look like it when you open it in the GUI, but there is
not. If you want a particular order, you have to impose it in a query. You
should always export from a query rather than directly from a table.
 
H

Howard

Hi Roger,

Thanks very much for your quick response. I'm currently
using "docmd.TransferText acImportFixed/acExportFixed".
Could you give me examples how to use query to do import
and emport?

Thank you again!

Howard
 
R

Roger Carlson

Well, it depends how you are exporting it. You simply specify the name of a
query, rather than a table. It works the same way.

You cannot import to a query. You have to import to a table, but you should
never care about the sort order of a table. You can always create a query
to sort your records. Your users should NEVER see the tables. They should
only see queries, forms and reports.
 
H

Howard

Roger--
Thanks a lot!
--Howard

-----Original Message-----
Well, it depends how you are exporting it. You simply specify the name of a
query, rather than a table. It works the same way.

You cannot import to a query. You have to import to a table, but you should
never care about the sort order of a table. You can always create a query
to sort your records. Your users should NEVER see the tables. They should
only see queries, forms and reports.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org




.
 

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


Top