GetLinksBySQLCond Method (ActiveX/CAO)

Gets a Links collection based on link template, SQL condition, and (optionally) link type.

Signature

VBA / VB.NET

RetVal = object.GetLinksBySQLCond(LinkTemplate, Condition [, LinkTypes] [, Document])
object

Type: DbConnect

The object or objects this method applies to.

LinkTemplate

Type: LinkTemplate, or String identifying a link template; input-only

Specifies the link template whose links are returned.

Condition

Type: String; input-only

The WHERE clause of the SQL statement, identifying the conditions to be met.

LinkTypes

Type: Integer; input-only; optional

Specifies the type of links to return. You can specify any combination of the following link types:

  • kEntityLinkType: Entity links
  • kFSLabelType: Freestanding labels
  • kAttachedLabelType: Attached labels

If no value is specified, only entity links are returned.

Document

Type: AcadDocument; input-only; optional

This argument is ignored if a LinkTemplate object is passed as the first argument. If this argument is not specified, the document object is identified as follows:

  • If the LinkTemplate argument is a string naming a link template, the current document is used.
  • If the LinkTemplate argument is a LinkTemplate object, the link template document is used.
RetVal

Type: Links

The Links collection meeting the specified conditions.

Remarks

You must connect to the data source identified by LinkTemplate before issuing GetLinksBySQLCond.

The SQL conditions are applied to every linked row in the database, and the corresponding link object is returned if the conditions are met.