CdbTableDef::CreateProperty Method

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 pointer to a variant containing the initial property value. See the Value property for details.
BOOL bDDL =FALSE Optional. A Boolean indicating whether or not the created Property object is a Data Definition Language object. If TRUE, the created Property object can't be changed or deleted unless the user has dbSecWriteDef permission. The default is FALSE.

Usage

#include <afxole.h>
#include <dbdao.h>
...
CdbTableDef      td;
CdbProperty      prop;
COleVariant      vVal(FALSE, VT_BOOL);
...               // Initialize td, etc.
prop = td.CreateProperty(_T("Required"), dbBoolean, &vVal, FALSE);
td.Properties.Append( prop );