vba equivalent of object/type dump?

R

robert.waters

I am looking for a VBA function to dump the contents of an object or
type. Does one exist?
Or is there sufficient "reflection" capabilities that would allow me
to iterate through an object's members and dump their values?

I just created some simple (yet painful) O/RM for an Access database
and this ability would make testing very easy (compare objects to db
tables).

Thanks!
 
C

Cindy M.

Hi Robert.waters,
I am looking for a VBA function to dump the contents of an object or
type. Does one exist?
Or is there sufficient "reflection" capabilities that would allow me
to iterate through an object's members and dump their values?

No, there's nothing in VBA for this.

You're using a .NET Framework-capable language, I take it? You should
be able to use .NET reflection methods on the COM type libraries
indirectly, by analysing their InteropAssemblies (IAs).

If you need to discuss this in more detail I recommend a group that
deals with COM/.NET interop. You could try here:
http://social.msdn.microsoft.com/Forums/en-
US/os_interopscenarios/threads

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
R

robert.waters

Hi Robert.waters,


No, there's nothing in VBA for this.

You're using a .NET Framework-capable language, I take it? You should
be able to use .NET reflection methods on the COM type libraries
indirectly, by analysing their InteropAssemblies (IAs).

If you need to discuss this in more detail I recommend a group that
deals with COM/.NET interop. You could try here:http://social.msdn.microsoft.com/Forums/en-
US/os_interopscenarios/threads

Cindy Meister
INTER-Solutions, Switzerlandhttp://homepage.swissonline.ch/cindymeister(last update Jun 17 2005)http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)

Thanks. I am actually using Access (it's an existing system).
I am trying to refactor some spaghetti; much of the domain code is
littered throughout form code modules, in the form of ad-hoc ado
queries.
My idea was to generate class module skeletons (get/lets) from the db
schema, and having some object dump capabilities would have made
testing that much easier.
I ended up going with plain code modules (modObject-Name.bas) with Get/
Set functions, which works well enough.
I wold love to port this to C# (so that I can use nhibernate!), but my
users require the ability to drag-n-drop queries and reports
themselves. There's just nothing better than Access for that combined
functionality.

Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top