Import/Export Headache

  • Thread starter Thread starter Howard
  • Start date Start date
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
 
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.
 
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
 
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--
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




.
 
Back
Top