• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

Reading INI file array in DTS

I've got an INI file with data similar to the following:

[group]
table[0]=tblcalls
table[1]=tblaccepted
table[2]=tblrejected
...

I need to be able to read this through DTS, and at times the number of items in the array will change.  Does anyone know how to do this?
0
khooc
Asked:
khooc
1 Solution
 
Anthony PerkinsCommented:
>>and at times the number of items in the array will change<<
I am afraid to tell you that there is no concept of arrays in INI files.  As far as the INI is concerned it is not an array, just a list of items that happen to have [] brackets.  DTS will treat them exactly the same way.  In other words you can associate one Global Variable to one item.  So if the number of items is variable you may be SOL.

The only workaround, that I can think of is to use an ActiveX Script Task to read in the elements into a table.  But that defeats the whole object of using an INI file in the first place...

A better approach would be to convert the INI to an Xml document and pass that into a Stored Procedure where you can then shred it with OPENXML.
0
 
khoocAuthor Commented:
Hrmm... the requirements are already signed off, and I think the client really likes the INI idea.

oh well, time to hit the script!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now