CdbIndex::CreateField Method

Creates a new Field object (Microsoft Jet workspaces only).

Syntax

CdbFieldCreateField(LPCTSTR pstrName=NULL,

LONG lType=-1,

LONG lSize=-1);

Parameters

Type Example Description
LPCTSTR pstrName= NULL Optional. A pointer to a string that uniquely names the new Field object. See the Name property for details on valid Field names.
LONG lType=-1 Optional. An integer that determines the data type of the new Field object. See the Type property for valid data types.
LONG lSize=-1 Optional. An integer that indicates the maximum size, in bytes, of a Field object that contains text. See the Size property for valid size values. This argument is ignored for numeric and fixed-width fields.

Usage

#include <afxole.h>
#include <dbdao.h>
CdbIndex   idx;
CdbField   fld;
...
fld = idx.CreateField(_T("CarModel"), dbText, 30);
idx.Fields.Append( fld );