Solved

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

Posted on 2004-03-23
5
161 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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