handling variable object and attribute types

bobmac-

Registered User.
Local time
Yesterday, 18:38
Joined
Apr 28, 2008
Messages
59
Hi,

I'm creating an ERD. I need to be able to store object attributes where the object types may be many and the associated attribute types may be many or few.

I've seen examples where there is an 'Object_Type' table and a 'Attribute_Type' table, but how do I relate these two tables to actual objects? i.e. I need a construct that enables me to create the erd for numerous object and attribute types.

Thanks in advance
Your help will be greatly appreciated

Cheers
Bob
 
If you have a prime key (PK) - call it ObjID - on your object and use the value of the key on a table with an ObjID field as a foreign key (FK), you can make a list of attributes and values. If the attribute names are predefined, you can constrain them by defining them on form using a combo box. Then enter the values of the attributes as a second field. If the ObjID is a number and you constrain the attributes to a list, that can be another number. Which would give you two numbers and the value you want.

The catch might be the format of the attribute, which would have to be defined in the attribute properties as a data type. But since you cannot make a record with a field of type variant very easily, the other choice would be to store the data as a string representation of the attribute's values converted for display purposes, then convert to the correct data type when you need to use that attribute in some computation or comparison.
 
Many thanks, That sounds good to me.

Cheers
Bob
 

Users who are viewing this thread

Back
Top Bottom