Link to home
Start Free TrialLog in
Avatar of EnolaKotrotsos
EnolaKotrotsos

asked on

dynamic data to class. Best way to accomplish this...

suppose I have a function that aggregrates data from different sources (Mostly SQL sources), and then suppose I have a class (DLL or in another way) that exports this data.

Now,
I do not know the extend of the aggregrated data...it could contain financial fields, or quotation fields, or other type of data...
therefor I do not know beforehand how large and what type (what fields) I need to pass to my Class...

How can I set this up that the Class will accept the data in some sort of structure of collection so I can process that data. I usually need the fieldname/Value pair for processing in the class. Do I use collections? Or structures? But can these structures be build dynamic so it will accomendate for the differente types of fields/data...

simply put, How Can I build a generic data harvester/exporter?
ASKER CERTIFIED SOLUTION
Avatar of inthedark
inthedark
Flag of United Kingdom of Great Britain and Northern Ireland 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
Avatar of EnolaKotrotsos
EnolaKotrotsos

ASKER

Yes, that would be terrific...And I think that will work....
I built a magic collection class that dynamically creates fields and sub instances of itself it works a bit like a handbag.  I use it as a common data transport between classes.  It saves having to define a UDT or class for every little thing.

I use arrays instead of collections as they are faster.  But I created a version that uses collections and posted some sample code here.

zMagicClass coe is here:
https://www.experts-exchange.com/questions/20403690/Trapping-Locked-error.html


Disconnected recordset example:

https://www.experts-exchange.com/questions/20638939/Access-Name-of-A-memebr-of-UDT.html?query=disconnected+recordset+ford+bbc&searchType=all

You can save the data in the set using the RS.Save method.  And you can reopen the data using a simple RS.Open "C:\MyFolder\MyFile.xxx"
fantastic, thanks a million...