Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

import spec: order in which they are loaded in the table

I have a import spec from a comma deliminated file.  I need to load the items into the table in the order that they appeared in the .csv file. How?

(or at least i have to have some way of determining where they where in the file)
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

to be able to determine which records came from which file
- add a field to your destination table and name it "Source"

after the import line run an update query to update the "source" field with the filename of the source

currentdb.execute "update tablex set [source]= '" & fileName & "' where [source] is null"
After you import the data, add an autonumber column.  That will be assigned based on the physical sequence of the data which presumably was the order in which it was imported.

If you are appending to an existing table, make sure the table already has an autonumber defined.

Later on, sorting by the autonumber column will give you data entry order.
Avatar of vbnetcoder
vbnetcoder

ASKER

Pat Hartman -

So as long as i have the auto number in the table that will be the order in which they where in the source file? If so that would be perfect for what i need.
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ty