Add

ACAD Connectivity Automation Objects

 
Add
 
 
 

Adds a new object to the specified collection.

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 object

The newly added object.

RetVal = object.Add(FieldName, Value)

Object

KeyValue object

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 object

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 object

The newly added object.

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

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

Link template name.

KeyDescriptions

KeyDescriptions collection; input-only

Key descriptions for the link template.

RetVal

LinkTemplate object

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 object

The newly added object.

See Also