A list of allowable DAO user-defined properties

J

JGPatrick

Reading Hennig et. al. Access 2007 VBA Programmer's Reference, and have a
question about DAO user-defined properties.

These are not totally user-defined, because Access knows what to do with the
property.

For instance, if you user the CreateProperty method of the DAO.Database
object to create a property with the name "Description", and you append it to
the Properties collection of a DAO.Field object, Access knows to add that
description to the field in the design view of a table.

So there must exist a list of allowable names for these user-defined
properties, as well as a list of corresponding datatypes and values to use in
the CreateProperty method.

My question is, where can I find such a list?
 
G

Gina Whipp

JGPatrick,

Okay, could be me but User-Defined is just that *YOU* the user define the
function. *YOU* the user define the datatype. All you have to do is stay
away from the Reserved Words. So could you explain why you think there
would a list of functions that *You* the user have defined?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

David C. Holley

First, in your example you using two DIFFERENT objects - a Database object
and a Field object. It is entirely within the right of the designers to
define a property for one object but not another.

Second, I looked at the documentation and based on it, it looks as if the
designers didn't formally declare a 'Description' property. Based on the
documentation that I found, I would assume that the designers added the
'Description' column to the Table Design window because they could forsee it
being useful without actually establishing 'Description' as a property of
the field. That would suggest that technically it is a USER DEFINED
property, although Access has buit-in functionality to handle that specific
property should it exist. I'm guessing that they took this approach because
they knew that not everyone would be utilizing the property, where as the
formally declared properties listed here
(http://msdn.microsoft.com/en-us/library/ee336059.aspx) are either required
(such as Name, Field Size, Required) or most likely to be defined by the
user (such as DefaultValue)

Full documentation is available here
http://msdn.microsoft.com/en-us/library/bb177493.aspx
http://msdn.microsoft.com/en-us/library/ee336059.aspx

So to answer the question YES the information is available and that's where
you can find it.
 
J

JGPatrick

Gina, David,

I have given two examples of "user-defined" properties which are recognized
by Access as a comment on the MSDN support page:

http://msdn.microsoft.com/en-us/library/bb177470.aspx

David, thanks for your explanation. Whether they should be called
properties, or whether they should be called user-defined, is a good point;
I'm actually using the terminology of Hennig et al, who call the Description
"property" a user-defined property.

But my question is, if we ever wanted to work with these properties in VBA,
how would we do it? For instance, if we want to add a Description "Ask John"
in VBA, you just have to
know that the correct arguments for the CreateProperty method are
"Description",
dbText, "Ask John". You would not, for instance, see a Description property
in the
IntelliSense menu for the Field object, and you would not find the
Description property in the object browser.

As far as I can see, the only way to do it is to have access to some sort of
list
of recognized "user-defined" properties, and that doesn't seem to exist.
 
D

David C. Holley

Please refer to the link that I posted earlier. MS has extensive
documentation available online concerning the Access Object Model. The
documentation confirms that 'Description' isNOT a part of the Access Object
Model. The Object Model details the objects in Access, their properties and
their methods. If you don't see it there, it doesn't exist.

Anything else is a [user-defined] property. The key adjective being
[user-defined] meaning that it is defined by the USER and not Access.

Regardless of the property is native or [user] defined, Access treats both
as 'properties' meaning that you can loop through the properties of an
object and examine them all. If a property is revealed to exist that does
not exist in the OBJECT MODEL documentation, then it is by conclusion user
defined.

You have got to accept the concept that there can be GUI-related code within
Access that takes input from the user working with the GUI and creates a
property on the fly such as the 'Description' field display in Table Design.
Just because the [[[[ GUI ]]]] shows an area where you can enter the value
DOES NOT mean that its an Access-defined (native) property. Just because the
OBJECT MODEL shows that a property does not exist [[[[ DOES NOT MEAN ]]]]
that there can't be code within Access that takes information provided by
the user via the GUI and creates a property on the fly using the same
technique that you as the user would use in VBA code. Functionality in one
part of a program CAN BE used by code in another part.
 
D

david

Good question, but no, I've never seen a list of the user-defined
properties which are recognised by the Access IDE.

The best I can suggest is searching for CreateProperty in the help
file. If the help is working, that should give you everything, but
not in a list form.

By the way, originally Access was based on Access, and
"properties" were values stored in a table. They had a second
shot at this with Access 2000 and SQL Server, where again
they tried to store everything in a database using the basic database
services, and my guess was that they were going to try to have
a third crack at it with WinFS, before that crashed and burned.

(david)
 
D

david

A start, but no banana. It doesn't list the properties shown
in the help file for CreateProperty. Things like

AllowBypassKey
DatasheetBackColor
LogMessages
UseTransaction

and, the original item, "Description"

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top