Item Property

This read-only property accesses a column (IColumn interface) by its Name property.

Syntax

IColumns[.Item(Column)]

Parameters

Column

An optional text string specifying the column to access.

Remarks

Since IColumns is a collection, you need only include Item to access an IColumn object by name (see the following Example).

Example

The following example displays the name of the columns for the KMSampleCatalog1 catalog definition's schema.

Option Explicit 
On Error Resume Next

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objSchema, objColumns, objColumn 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1")
Set objBuildServer = objSearchAdmin.BuildServer
Set objCatalogs = objBuildServer.BuildCatalogs 
Set objCatalog  = objCatalogs("KMSampleCatalog1")
Set objSchema   = objCatalog.objSchema 
Set objColumns  = objSchema.objColumns

Wscript.Echo objCatalog.Name & " has the following schema columns:" 

For Each objColumn in objColumns
  Wscript.Echo "  " & objColumn.Name
Next

'Release objects
Set objColumn   = Nothing 
Set objColumns  = Nothing 
Set objSchema   = Nothing 
Set objCatalog  = Nothing 
Set objCatalogs = Nothing 
Set objBuildServer = Nothing 
Set objSearchAdmin = Nothing 
 

See Also

IColumn, Count


© 1997-1998 Microsoft Corporation. All rights reserved.