MyDB.Properties(PropName) = PropValue
AddStartupProperty = True
AddStartupProp_OK:
Exit Function
AddStartupProp_Err:
???Get here if property doesn??™t exist.
If Err = _PropNotFoundError Then
???Create the new property and set it to PropValue
Set MyProperty = MyDB.CreateProperty(PropName, _
PropType, PropValue)
ON the CD-ROM
900
Professional Database Development Part IV
???You must append the new property
???to the Properties collection.
MyDB.Properties.Append MyProperty
Resume
Else
???Can??™t add new property, so quit
AddStartupProperty = False
Resume AddStartupProp_OK
End If
End Function ???AddStartupProperty
Using AddStartupProperty() is quite easy. You must know the exact property name and data
type of the property before invoking AddStartupProperty(). The following subroutine
demonstrates how to set a startup property with AddStartupProperty():
Sub cmdAddProperty_Click()
Dim iRetVal As Integer
iRetVal = AddStartupProperty(???AppTitle???, dbText,
???Marketing Contact Management???)
iRetVal = AddStartupProperty(???AppIcon???, dbText,
???C:\My Documents\World.
Pages:
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708