Avatar of machine_run
machine_run
Flag 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?
Microsoft AccessWindows BatchMicrosoft ApplicationsVBA

Avatar of undefined
Last Comment
machine_run

8/22/2022 - Mon
SOLUTION
NVIT

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jeffrey Coachman

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?
machine_run

ASKER
JC, just trying to compare the header of the new file with what I expected to see.
Jeffrey Coachman

So comparing a "Reference" header to the current header?  Correct?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
SOLUTION
Nick67

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jim Dettman (EE MVE)

I use Nick's method, but not the file system object.   I just use an Open and a Input in VBA.

Jim.
machine_run

ASKER
Jim,
Would you have some example code showing that?
Thanks
ASKER CERTIFIED SOLUTION
Bill Prew

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
machine_run

ASKER
THANKS!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.