Collections, Collections and More Collections 
Author Message
 Collections, Collections and More Collections

Hi all. I have a question to which, hopefully, the answer is "Yes". I have
a database that I have added a custom property to. This property cotains a
path that is used to refresh links to the data tables in another Access DB.
I did this so I can easily change the data source between Production, QA
and Development. Here is a fully qualified example to return the path
(DataInfoSource is the name of the custom property):

        Dim db as Database
        Dim str as String

        Set db = CurrentDb

        str = db.Properties("DataInfoSource").Value

        Debug.Print str

The Immediate Pane will display the value of DataInfoSource (eg.
"\\server_qa\sys\users\dbs\datSecMk.mdb" if in QA,
"\\server_prod\sys\users\dbs\datSecMk.mdb" if in Production). The bottom
line is I use a form to change the property and then refresh the table
links.

Now to my question... Can you a custom Collection to a Database object like
you can add a custom Property? I want to do something like the following:

db.Properties(20).Imports(0).Elements(0).RcptTable

Where   RcptTable is a custom Property of Element
        Element is an Item in the Elements Collection
        Elements is a Collection and a custom Property of Import
        Import is an Item in the Imports Collection
        Imports is a Collection and a custom Property of Properties
        Properties is a Collection and a Property of Database
        Database is the Current Database

I know I don't want much (ha, ha) but maybe someone out there has done
something similar. Thanks, in advance for any assistance.



Wed, 28 Aug 2002 03:00:00 GMT  
 Collections, Collections and More Collections
I don't believe you can do something like that. I would say that a
series of related tables is much preferred way of implementing such a
model. We are talking databases after all <g>.



Quote:
>Now to my question... Can you a custom Collection to a Database
>object like you can add a custom Property? I want to do something
>like the following:

>db.Properties(20).Imports(0).Elements(0).RcptTable

--
(remove a 9 to reply by email)


Wed, 28 Aug 2002 03:00:00 GMT  
 Collections, Collections and More Collections
Sorry, you cannot really do this.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
54-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at the (no scripts required!)
http://www.trigeminal.com/

?

Quote:
> Hi all. I have a question to which, hopefully, the answer is "Yes". I have
> a database that I have added a custom property to. This property cotains a
> path that is used to refresh links to the data tables in another Access
DB.
> I did this so I can easily change the data source between Production, QA
> and Development. Here is a fully qualified example to return the path
> (DataInfoSource is the name of the custom property):

> Dim db as Database
> Dim str as String

> Set db = CurrentDb

> str = db.Properties("DataInfoSource").Value

> Debug.Print str

> The Immediate Pane will display the value of DataInfoSource (eg.
> "\\server_qa\sys\users\dbs\datSecMk.mdb" if in QA,
> "\\server_prod\sys\users\dbs\datSecMk.mdb" if in Production). The bottom
> line is I use a form to change the property and then refresh the table
> links.

> Now to my question... Can you a custom Collection to a Database object
like
> you can add a custom Property? I want to do something like the following:

> db.Properties(20).Imports(0).Elements(0).RcptTable

> Where RcptTable is a custom Property of Element
> Element is an Item in the Elements Collection
> Elements is a Collection and a custom Property of Import
> Import is an Item in the Imports Collection
> Imports is a Collection and a custom Property of Properties
> Properties is a Collection and a Property of Database
> Database is the Current Database

> I know I don't want much (ha, ha) but maybe someone out there has done
> something similar. Thanks, in advance for any assistance.



Wed, 28 Aug 2002 03:00:00 GMT  
 Collections, Collections and More Collections
Yea, I guess I'll just use tables. Thanks for the advice. Just out of
curiosity, what are the advantages of using a dbTableType recordset vs a
dbOpenDynaset recordset? The former is the default but you cannot use the
Find methods with it. I think you can use the Seek method however. Any
ideas?



Quote:
> I don't believe you can do something like that. I would say that a
> series of related tables is much preferred way of implementing such a
> model. We are talking databases after all <g>.



Thu, 29 Aug 2002 03:00:00 GMT  
 Collections, Collections and More Collections
AFAIK, Seek is the main difference. BTW, Tabletype is not always the
default. You can't use it for linked tables, so in that case default is
dynaset.



Quote:
>Yea, I guess I'll just use tables. Thanks for the advice. Just out
>of curiosity, what are the advantages of using a dbTableType
>recordset vs a dbOpenDynaset recordset? The former is the default
>but you cannot use the Find methods with it. I think you can use the
>Seek method however. Any ideas?



>> I don't believe you can do something like that. I would say that a
>> series of related tables is much preferred way of implementing
>> such a model. We are talking databases after all <g>.

--
(remove a 9 to reply by email)


Thu, 29 Aug 2002 03:00:00 GMT  
 Collections, Collections and More Collections
A Dynaset type recordset can be on more than one table, a Table type must be
on one table. I see that as a main difference, too.

--
Regards,
Bas Cost Budde, Holland
website: http://utopia.knoware.nl/users/hegedu

Quote:

>Yea, I guess I'll just use tables. Thanks for the advice. Just out of
>curiosity, what are the advantages of using a dbTableType recordset vs a
>dbOpenDynaset recordset? The former is the default but you cannot use the
>Find methods with it. I think you can use the Seek method however. Any
>ideas?



>> I don't believe you can do something like that. I would say that a
>> series of related tables is much preferred way of implementing such a
>> model. We are talking databases after all <g>.



Fri, 30 Aug 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Document collections and AllForms collections

2. Creating a CDO collection from an Outlook collection

3. using collection of collections

4. Storing a collection in a collection

5. collection in collection

6. Migrating to System.Collections.IEnumerator from VB6.Collection

7. Persisting a Collection of a Collection

8. Collection of Collections?

9. Collections, swapping items in a collection

10. Collections of Collections..how?

11. collections of collections

12. Collection of Collections

 

 
Powered by phpBB® Forum Software