Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

680 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