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)
(or at least i have to have some way of determining where they where in the file)
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.
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ty
- 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"