Link to home
Start Free TrialLog in
Avatar of machine_run
machine_runFlag for United States of America

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?
SOLUTION
Avatar of NVIT
NVIT
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
And what if they are different...?
...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?
Avatar of machine_run

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
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
I use Nick's method, but not the file system object.   I just use an Open and a Input in VBA.

Jim.
Jim,
Would you have some example code showing that?
Thanks
ASKER CERTIFIED SOLUTION
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
THANKS!