machine_run
asked on
How to check csv header before Access 2000 import?
A company leaves a csv file on a server every night. A script downloads it and then an Access 2000 MDB attempts to import it with an Import Specification.
However, the company may change the header at any time, including changing the order of the fields, names of the fields, or adding or deleting fields. This happens rarely.
What is a way to check the header of the csv file first, perhaps by comparing it to a saved version?
However, the company may change the header at any time, including changing the order of the fields, names of the fields, or adding or deleting fields. This happens rarely.
What is a way to check the header of the csv file first, perhaps by comparing it to a saved version?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
JC, just trying to compare the header of the new file with what I expected to see.
So comparing a "Reference" header to the current header? Correct?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I use Nick's method, but not the file system object. I just use an Open and a Input in VBA.
Jim.
Jim.
ASKER
Jim,
Would you have some example code showing that?
Thanks
Would you have some example code showing that?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
THANKS!
...then what?
Are you comparing all subsequent files to one standard (reference) file, ...or are you wanting to just compare the file being imported to the previous file?