[AccessD] When is a collection not a collection?

Jim DeMarco Jdemarco at hudsonhealthplan.org
Tue Oct 25 13:23:36 CDT 2005


Ahh...experimentation on such a beautiful day in the northeast (we're sitting in the midst of a nor'easter all day today for the rest of the world!!).

Jim D.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John Colby
Sent: Tuesday, October 25, 2005 2:17 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] When is a collection not a collection?


>Not sure what you're after then.

LOL.

I was just writing a little app that needs to iterate collections of objects
and examine the properties.  I fleshed it out, all things equal (everything
including my clsObjProperties using a collection to hold the collection of
objects).  It works for everything else, just not properties.  Instead of
just dimming a collection object into which you throw the pointer to the
properties collection, you have to dim a Properties object.  I just found it
interesting and annoying.

I'm not "after" anything really except to point out to the group that you
have to treat properties differently than all the other objects in the db
container.  Well... I haven't gotten to EVERYTHING yet, just the tbldefs on
down.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim DeMarco
Sent: Tuesday, October 25, 2005 2:02 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] When is a collection not a collection?


Not sure what you're after then.

Jim D.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John Colby
Sent: Tuesday, October 25, 2005 1:55 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] When is a collection not a collection?


You can iterate the collection just fine

Dim prp as dao.property
	for each prp in MyObject.Properties
	Next prp



John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim DeMarco
Sent: Tuesday, October 25, 2005 1:47 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] When is a collection not a collection?


Can you declare it a Variant and access the collection?

Or... dim a collection then loop through the Properties collection and
populate your collection manually?  A custom collection class may serve you
better to preserve name/value pairs though.

Jim DeMarco

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John Colby
Sent: Tuesday, October 25, 2005 1:41 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] When is a collection not a collection?


When it is a properties collection?

Try dimming a collection

Dim lcol as collection

Then try setting that collection to any DAO object's properties collection:

	set lcol = MyFld.Properties

Or 	
	set lcol = MyTDF.Properties

You will get a run time error: "Type Mismatch"

Sigh.

AFAICT, all of the other object collections in the database container - the
tabledefs, fields, forms etc are all true collections, i.e. you can dim a
collection and save a pointer to these object collections in your
collection.  Not so with the Properties collection of any object.

Sigh.

The properties collection has different properties and methods:

Append 
Count 
Delete
Refresh

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


 



****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from Hudson Health Plan (HHP) that is
confidential or privileged.  If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of the
contents of this message is strictly prohibited.  If you have received this
message in error or are not the named recipient, please notify us
immediately, either by contacting the sender at the electronic mail address
noted above or calling HHP at (914) 631-1611. If you are not the intended
recipient, please do not forward this email to anyone, and delete and
destroy all copies of this message.  Thank You".
****************************************************************************
*******

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from Hudson Health Plan (HHP) that is
confidential or privileged.  If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of the
contents of this message is strictly prohibited.  If you have received this
message in error or are not the named recipient, please notify us
immediately, either by contacting the sender at the electronic mail address
noted above or calling HHP at (914) 631-1611. If you are not the intended
recipient, please do not forward this email to anyone, and delete and
destroy all copies of this message.  Thank You".
****************************************************************************
*******

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


 



***********************************************************************************
"This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message.  Thank You".
***********************************************************************************




More information about the AccessD mailing list