Creates a new user-defined Property object.
Syntax
CdbPropertyCreateProperty(LPCTSTR pstrName=NULL,
LONG lType=-1,
LPVARIANT pvValue=NULL,
BOOL bDDL=FALSE);
Parameters
Type | Example | Description |
LPCTSTR | pstrName =NULL | Optional. A pointer to a string that contains the name of the new Property. |
LONG | lType | Optional. The type of the new Property. Its value may be one of those listed under "Types" in the core topic. |
LPVARIANT | pvValue =NULL | Optional. A Variant variable containing the initial property value. See the Value property for details. |
BOOL | bDDL =FALSE | Optional. A Boolean variable indicating whether or not the Property is a DDL object. The default is FALSE. If the bDDL is TRUE, this Property object can't be changed or deleted unless the user has dbSecWriteDef permission. |
Usage
#include <afxole.h>
#include <dbdao.h>
...
CdbIndex idx;
CdbProperty prop;
COleVariant vVal(FALSE, VT_BOOL);
// Initialize index, etc.
prop = idx.CreateProperty(_T("Required"), dbBoolean, &vVal, FALSE);
idx.Properties.Append( prop );