Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic Enum questions

Status
Not open for further replies.

VicM

Programmer
Sep 24, 2001
443
US
Hi,

From what I've read, I'd like to utilize Enums to keep track of columns in an Excel spreadsheet that's used to import data into a database. The company supplying the spreadsheet has had a penchant for changing, adding and deleting columns over the last couple of years. It's become a nightmare to recode the data import routine.

What I'd like to know is once I've established the Enums for the columns, if a column is added, I know I have to add that column to the Enum collection. If that column is added somewhere within the existing columns changing the column numbers of all that follow, do I physically have to reassign the column numbers following the added column? Or does that happen automatically once I tell the collection what the new column number is?

And if I put the Enum collection in its own Module in the DB, would there be a way for me to automate changes to the collection through a form the user can access?

Thanks,
Vic
 
Hi,

If the text file you get does not have consistent 1) column names/data types/position left to right, 2) missing column names or 3) new column names you have a real tripple nightmare.

Short of comparing a list you maintain with the imported columns for existence, data type & position, I don’t know what you could programmatically do with certainty.

But I don’t know the specifics. You’ve posted no examples of the kinds of anomalyies you can expect, and therefore program for, so what happens in vagueness stays in vagueness.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thanks Skip.

I'll just have to have the user check the columns to make sure the titles, positions and types are correct before processing the import.

Vic
 
If you can send them a template to fill in, you could set headers and protect worksheet with adding/deleting columns disabled (one of protection options).

combo
 
Or you can check that the document is in the correct format before processing and alert the user if there is a problem.
 
combo
Thanks for your suggestion. Unfortunately, the company supplying the spreadsheet data is privately owned and doesn't respond to inquiries. From their perspective, supplying the data is a necessary evil and they'll do it any way they choose.

DjangMan, that's what I think I'll have to do in this situation.

Thanks folks,

Vic

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top