DefaultValue property

Sets or returns the initial value for a Database Column.

Syntax


C++

HRESULT get_DefaultValue(VARIANT* pDefaultVal)

HRESULT put_DefaultValue(VARIANT defaultVal)

Scripting languages

Value = object.DefaultValue

object.DefaultValue = Value

Remarks


If the Database Column does not have an initial value, DefaultValue returns an empty variant. To clear an initial value that has already been set, use DefaultValue to pass in an empty variant.

The following table lists the data type stored in a VARIANT for each type of Database Column:

Column Data Type

Data Type Stored in VARIABLE

Plain Text

BSTR

HTML

BSTR

Number

BSTR

Date

LONG

Boolean

VARIANT_BOOL

Drop Down List

BSTR

Members

IERUMemberSet*

Approval

IERUMemberSet*

ApprovalDate

DATE

KeyWord

BSTR

TrafficLight

LONG

  • Attachments, Autonumber, Comments, History, DateDone and RoomID columns do not have initial values. Setting or getting the initial value of any of these columns returns an invalid operation error.

  • The initial value for Date columns is a LONG and not a DATE. The value represents the number of days added to the creation date of the row. For example, a value of 0 means that the creation date is the initial value. A value of 1 means that 1 day after the creation date is the initial value.

  • Prior to setting the DefaultValue for an Approval Column, you must call the SetMemberList method. Otherwise, the operation returns an invalid operation error.

  • Prior to setting the DefaultValue for a KeyWord Column, you must set the IERUDBColumn Choices property.

Home

Applies to

IERUDBColumn


See also

Databases