Text File Import Problem

  • Thread starter Thread starter Phil Mayer
  • Start date Start date
P

Phil Mayer

I have an application in Access 97 that runs on NT4 workstations. This
application has been in use for several years. Nothing in the code has
changed.

One of my users got a different PC. It still has NT4W on it, but the image
installed by our MIS group had Office 2000 sort of" installed -- the
installation wasn't correct, and I couldn't uninstall it. I deleted the
files for Office 2000 in the "Program Files" directory. I then installed
Office 97.

One of the functions of the application is to import the contents of a
fixed-length text file. The code I use to import the file is:

DoCmd.TransferText acImportFixed, "940 Import Specification", "Import 940",
TempFile, 0



When I try to import the file using her new PC, the records are not in the
same order that they are in the text file. Having the records in the same
order is CRITICAL.

What can I look for that might be screwing this up?

How can I force ACC97 to import the records in order?
 
Records in a table *have no order*...they are just stored in whichever order
ACCESS decides to use.

You use a query to order the records.

If you need to know the order as they were in the text file, you can use an
autonumber field in the table that is receiving the records. In most cases,
it will increment in a positive direction for each new record. Otherwise,
you'll need to use VBA code to assign a value to an "incrementing" field as
you import each record and write it to the table via a recordset.
 
Back
Top