CreateColumn method

Creates a new Column in a Database.

Syntax


C++

HRESULT CreateColumn (
   BSTR Name,

   ERUColumnType Type,

   IERUDBColumn** ppColumn)

Scripting languages

Set Column = Object.CreateColumn (
   Name as String,

   Type as ERUColumnType)

Parameters


Name

The name of the new column. Each column name must be unique within the database.

Type

The type of data to be stored in each cell of the column, as specified by the ERUColumnType enum.

Note: erColumnTypeApprovalDate, erColumnTypeDateDone, and erColumnTypeRoomID are invalid values.

The ApprovalDate column is automatically created when the Approval column is created. It stores the DATE value of the approval deadline. The name of the ApprovalDate column is the Approval column's name appended with "_Deadline."

The DateDone column is automatically created when the DateIsDue property is set to true on the Date column. It stores a BOOLEAN value indicating whether it is done. The name of the DateDone column is the Date column's name appended with "_IsDue."

The RoomID column is automatically created when an enterprise database is created or when a standalone database is converted to an enterprise database. Only one RoomID column can exist in an enterprise database. The name of the RoomID column is "Room." RoomID columns are not allowed in standalone databases.

ppColumn

Upon return, an IERUDBColumn interface pointer to the newly-created column.

Return value


C++

The return code.

Scripting languages

An IERUDBColumn interface pointer to the newly-created column.

Remarks


CreateColumn appends the new column to the Database, after the right-most column. Use SetColumnPosition to move the newly-created column.

A database can have a maximum of 100 columns.

Home

Interface

IERUDatabase


See also

IERUItem

IERUDBColumn


See also

Databases