CdbQueryDef::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 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 Optional. A pointer to a variant containing the initial property value. See the Value property for details.
BOOL bDDL 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>

CdbQueryDef      qd;
CdbProperty      prop;
COleVariant      vVal(FALSE, VT_BOOL);
...               // Initialize the qd, etc.  
...               // Create a property in the querydef
prop = qd.CreateProperty(_T("Required"), dbBoolean, &vVal, FALSE);
qd.Properties.Append( prop );