[AccessD] Fascinating behavior of database properties collection

John Colby jwcolby at gmail.com
Sat May 15 18:12:02 CDT 2021


This code:

Notice the count property of the collection says it has 56 properties, but
it only prints names and values for 10 of the properties.  At least using
the "For each" iterator.

However if I index in directly with an integer, for example
lProperties(40).name I get a value returned.

Function mIterateProperties(lProperties As DAO.Properties)
Dim lPrp As DAO.Property
Dim intIndex As Integer
    Debug.Print "Property Count : " & lProperties.Count
    For Each lPrp In lProperties
        intIndex = intIndex + 1
        Debug.Print intIndex & " : " & lPrp.Name & " : " & lPrp.Value
    Next lPrp
End Function

Gives this result:

Property Count : 56
1 : Name : C:\DavidEmbley\C2DbProperties\C2DbProperties2007.accdb
2 : Connect :
3 : Transactions : True
4 : Updatable : True
5 : CollatingOrder : 1033
6 : QueryTimeout : 60
7 : Version : 12.0
8 : RecordsAffected : 0
9 : ReplicaID :
10 : DesignMasterID :

Some of the values that can't be seen with the For Each iterator are:

      opt_StartupShowStatusBar = dbs.Properties("StartupShowStatusBar")
      opt_StartupShowDBWindow = dbs.Properties("StartupShowDBWindow")
      opt_AllowBuiltinToolbars = dbs.Properties("AllowBuiltinToolbars")
      opt_AllowFullMenus = dbs.Properties("AllowFullMenus")
      opt_AllowBreakIntoCode = dbs.Properties("AllowBreakIntoCode")
      opt_AllowSpecialKeys = dbs.Properties("AllowSpecialKeys")
      opt_AllowBypassKey = dbs.Properties("AllowBypassKey")
      opt_AllowShortcutMenus = dbs.Properties("AllowShortcutMenus")
      opt_AllowToolbarChanges = dbs.Properties("AllowToolbarChanges")

They return a boolean value.

Mighty strange if you ask me.

-- 
John W. Colby
Colby Consulting


More information about the AccessD mailing list