I have a number of question in this area. I will post them one at a time based on answers.
================
Question #1
================
If I run the following code,, the two databases are added to the Workspace Collection.
NOTE: GetPath is a function that returns the database Path.
The ENUMs used in function identify which database path.
However, if I change the above code by either:
1) Changing the object variable dbSrc to dbDAO
-OR_
2) Add a line (Set dbSrc = Nothing) AFTER the database dbSrc is added to the Collection
ONLY the first database (ie. dbDAO above), is included in the collection..
=================================================
Can someone please explain why using the same object variable OR destroying the second object variable
after the collection is created, reduces the collection to just one item within the collection.
Thanks
================
Question #1
================
If I run the following code,, the two databases are added to the Workspace Collection.
NOTE: GetPath is a function that returns the database Path.
The ENUMs used in function identify which database path.
'All three object variables are PUBLIC, but shown here for INFO ONLY
Dim wrk As DAO.Workspace
Dim dbDAO As Database
Dim dbSrc As Database
Set wrk = DBEngine(0)
Set dbDAO = wrk.OpenDatabase(GetPath(PATH_DATA_DB, False)
Set dbSrc = wrk.OpenDatabase(GetPath(PATH_DATA_HISTDB), False)
>>> NOTE: The Workspace Collection, now contains two databases (indexes 0 and 1).
However, if I change the above code by either:
1) Changing the object variable dbSrc to dbDAO
-OR_
2) Add a line (Set dbSrc = Nothing) AFTER the database dbSrc is added to the Collection
ONLY the first database (ie. dbDAO above), is included in the collection..
=================================================
Can someone please explain why using the same object variable OR destroying the second object variable
after the collection is created, reduces the collection to just one item within the collection.
Thanks