Add [Connectivity Automation Reference: CAR]

Add Method


Adds a new object to the specified collection.

See Also

Signatures: Overview

KeyDescriptions

RetVal = object.Add(Name, DataType [, Precision] [, Scale])

KeyValues

RetVal = object.Add(FieldName, Value)

LabelTemplates

RetVal = object.Add(DataSource,Catalog, Schema, Table, Name, DisplayAttributes)

LinkTemplates

RetVal = object.Add(DataSource, Catalog, Schema, Table, Name, KeyDescriptions)

Queries

RetVal = object.Add(DataSource, Catalog, Schema, Table, Name, SQLText)

Signatures: Detail

RetVal = object.Add(Name, DataType [, Precision] [, Scale])

Object

KeyDescriptions Collection
The object or objects this method applies to.

Name

String; input-only
The name of the column to be added.

DataType

CaoDataType enum; input-only
The data type of the column being added. Specify one of the following constants:

kCaoTypeText

kCaoTypeNumeric

kCaoTypeInteger

kCaoTypeDouble

kCaoTypeDate

kCaoTypeTime

kCaoTypeTimestamp

kCaoTypeBit

kCaoTypeBlob

Precision

Integer; input-only; optional
The meaning of Precision depends on the DataType specified, as follows:

kCaoTypeNumeric: Precision of numeric data.

kCaoTypeText: Length of data in symbols.

kCaoTypeBlob: Length of data in bits.

Precision is ignored for all other data types.

Scale

Integer; input-only; optional
Numeric scale for kCaoTypeNumeric. Ignored for all other data types.

RetVal

KeyDescription
The newly added object.


RetVal = object.Add(FieldName, Value)

Object

KeyValues Collection
The object or objects this method applies to.

FieldName

String; input-only
The name of the field to be added.

Value

Variant; input-only
The value of the field being added.

RetVal

KeyValue
The newly added object.


RetVal = object.Add(DataSource, Catalog, Schema, Table, Name, DisplayAttributes)

Object

LabelTemplates Collection
The object or objects this method applies to.

DataSource

String; input-only
Data source name.

Catalog

String; input-only
Catalog name.

Schema

String; input-only
Schema name.

Table

String; input-only
Table name.

Name

String; input-only
Label template name.

DisplayAttributes

Variant (String or array of strings); input-only
Column names to be displayed as label or format strings. Where a single string is specified, CAO assumes the string is a format string. An array of strings is interpreted as a list of column names.

Format strings are compatible with MTEXT format strings. Refer to database table columns in format strings using the following syntax:

#(<column name>)

For example:

#(name)

Column names are converted to the following format string:

#(<column name 1>\P#(<column name 2>)

RetVal

LabelTemplate
The newly added object.


RetVal = object.Add(DataSource, Catalog, Schema, Table, Name, KeyDescriptions)

Object

LinkTemplates Collection
The object or objects this method applies to.

DataSource

String; input-only
Data source name.

Catalog

String; input-only
Catalog name.

Schema

String; input-only
Schema name.

Table

String; input-only
Table name.

Name

String; input-only
Link template name.

KeyDescriptions

KeyDescriptions collection; input-only
Key descriptions for the link template.

RetVal

LinkTemplate
The newly added object.


RetVal = object.Add(DataSource, Catalog, Schema, Table, Name, SQLText)

Object

Queries Collection
The object or objects this method applies to.

DataSource

String; input-only
Data source name.

Catalog

String; input-only
Catalog name.

Schema

String; input-only
Schema name.

Table

String; input-only
Table name.

Name

String; input-only
Link template name.

SQLText

String; input-only
The SQL statement.

RetVal

Query
The newly added object.