Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-03-23
5
Medium Priority
?
167 Views
Last Modified: 2010-05-01
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?
0
Comment
Question by:EnolaKotrotsos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
inthedark earned 2000 total points
ID: 10655970
Have you thought of using a disconnect ADO recordset?  All the code is there to convert to string and back.  Would you like a code sample?
0
 
LVL 1

Author Comment

by:EnolaKotrotsos
ID: 10655987
Yes, that would be terrific...And I think that will work....
0
 
LVL 17

Expert Comment

by:inthedark
ID: 10656029
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:
http://www.experts-exchange.com/Databases/MS_Access/Q_20403690.html


0
 
LVL 17

Expert Comment

by:inthedark
ID: 10656120
Disconnected recordset example:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20638939.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"
0
 
LVL 1

Author Comment

by:EnolaKotrotsos
ID: 10656150
fantastic, thanks a million...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question