Solved

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

Posted on 2004-03-23
5
159 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
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
inthedark earned 500 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now