[AccessD] Fascinating behavior of database properties collection
Stuart McLachlan
stuart at lexacorp.com.pg
Sat May 15 20:15:02 CDT 2021
Managed to derive all of the possible Property Types according to:
https://docs.microsoft.com/en-us/office/client-developer/access/desktop-database-reference/
property-type-property-dao
There is no defined Type 0, so I'm guessing that it is used for a pre-defined property with no
value.
FWIW, here are the type values:
1 dbBoolean
2 dbByte
3 dbInteger
4 dbLong
5 dbCurrency
6 dbSingle
7 dbDouble
8 dbDate
9 dbBinary
10 dbText
11 dbLongBinary
12 dbMemo
15 dbGUID
16 dbBigInt
17 dbVarBinary
18 dbChar
19 dbNumeric
20 dbDecimal
21 dbFloat
22 dbTime
23 dbTimeStamp
A conditional display based on type may be useful in your property iteration.
On 16 May 2021 at 10:54, Stuart McLachlan wrote:
>
> "Connection" appears to be the only property of Type 0 in my test
> accdb. So it may be desireable to test for that.
>
> Debug.Print intIndex & " : " & lPrp.Name & " : " & lPrp.Type
> (Where does one find the enumerations for property type? )
>
> Property Count : 47
> 1 : Name : 12
> 2 : Connect : 12
> 3 : Transactions : 1
> 4 : Updatable : 1
> 5 : CollatingOrder : 3
> 6 : QueryTimeout : 3
> 7 : Version : 12
> 8 : RecordsAffected : 4
> 9 : ReplicaID : 15
> 10 : DesignMasterID : 15
> 11 : Connection : 0
> 12 : ANSI Query Mode : 4
> 13 : Themed Form Controls : 4
> 14 : Use Microsoft Access 2007 compatible cache : 4
> 15 : Clear Cache on Close : 4
> 16 : Never Cache : 4
> 17 : AccessVersion : 10
> 18 : NavPane Category : 4
> 19 : Show Navigation Pane Search Bar : 4
> 20 : Build : 4
> 21 : ProjVer : 3
> 22 : HasOfflineLists : 3
> 23 : UseMDIMode : 2
> 24 : ShowDocumentTabs : 1
> 25 : Picture Property Storage Format : 4
> 26 : WebDesignMode : 2
> 27 : CheckTruncatedNumFields : 4
> 28 : Theme Resource Name : 10
> 29 : StartUpShowDBWindow : 1
> 30 : StartUpShowStatusBar : 1
> 31 : AllowShortcutMenus : 1
> 32 : AllowFullMenus : 1
> 33 : AllowBuiltInToolbars : 1
> 34 : AllowToolbarChanges : 1
> 35 : AllowSpecialKeys : 1
> 36 : UseAppIconForFrmRpt : 1
> 37 : AllowDatasheetSchema : 1
> 38 : DesignWithData : 1
> 39 : Show Values Limit : 4
> 40 : Show Values in Indexed : 4
> 41 : Show Values in Non-Indexed : 4
> 42 : Show Values in Remote : 4
> 43 : Auto Compact : 4
> 44 : NavPane Closed : 4
> 45 : NavPane Width : 4
> 46 : NavPane View By : 4
> 47 : NavPane Sort By : 4
>
> On 15 May 2021 at 20:09, John Colby wrote:
>
> > I wasn't trapping errors and Property(10) which is a connection
> > object (apparently) could not convert to a string to print out.
> > Thus the loop errored, bubbled up to the next higher level and
> > appeared to not exist after that.
> >
> > I put on error resume next before the problematic line and found it.
> >
> > Property Count : 56
> > 1 : Connect :
> > 2 : Transactions : True
> > 3 : Updatable : True
> > 4 : CollatingOrder : 1033
> > 5 : QueryTimeout : 60
> > 6 : Version : 12.0
> > 7 : RecordsAffected : 0
> > 8 : ReplicaID :
> > 9 : DesignMasterID :
> > 11 : AccessVersion : 09.50
> > 12 : Build : 606
> > 13 : AppTitle : C2DbProperties2007
> > 14 : StartUpShowDBWindow : True
> > 15 : StartUpShowStatusBar : True
> > 16 : AllowShortcutMenus : True
> > 17 : AllowFullMenus : True
> > 18 : AllowBuiltInToolbars : True
> > 19 : AllowToolbarChanges : True
> > 20 : AllowSpecialKeys : True
> > 21 : HijriCalendar : False
> > 22 : Auto Compact : 0
> > 23 : Perform Name AutoCorrect : 0
> > 24 : Log Name AutoCorrect Changes : 0
> > 25 : Track Name AutoCorrect Info : 0
> > 26 : Four-Digit Year Formatting : 0
> > 27 : Show Values Limit : 1000
> > 28 : Show Values in Indexed : 1
> > 29 : Show Values in Non-Indexed : 1
> > 30 : Show Values in Remote : 0
> > 31 : Show Values in Snapshot : 1
> > 32 : Show Values in Server : 0
> > 33 : Row Limit : 10000
> > 34 : AllowBreakIntoCode : True
> > 35 : AllowBypassKey : True
> > 36 : StartUpForm : frm_CopyFiles
> > 37 : ProjVer : 119
> > 38 : UseAppIconForFrmRpt : False
> > 39 : Use Default Page Folder : 0
> > 40 : Use Default Connection File : 0
> > 41 : ANSI Query Mode : 0
> > 42 : NavPane Closed : 0
> > 43 : NavPane Width : 215
> > 44 : NavPane Category : 0
> > 45 : NavPane View By : 0
> > 46 : NavPane Sort By : 1
> > 47 : HasOfflineLists : 70
> > 48 : UseMDIMode : 1
> > 49 : ShowDocumentTabs : True
> > 50 : AllowDatasheetSchema : True
> > 51 : Picture Property Storage Format : 1
> > 52 : Theme Resource Name : Office Theme
> > 53 : Show Navigation Pane Search Bar : 0
> > 54 : WebDesignMode : 0
> > 55 : DesignWithData : True
> > 56 : DesignWithData : True
> >
> > ? lproperties(10).Name
> > Connection
> >
> >
> >
> > On Sat, May 15, 2021 at 7:28 PM Bill Benson <bensonforums at gmail.com>
> > wrote:
> >
> > > Many properties have no value until set.
> > >
> > > On Sat, May 15, 2021 at 7:12 PM John Colby <jwcolby at gmail.com>
> > > wrote:
> > >
> > > > 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.
> > > >
> > > > --
More information about the AccessD
mailing list