1.8 Field Object

A column of data with a common data type.

1.8.1 DefinedSize property

Indicates the defined size of a Field object.

Syntax

object.DefinedSize

Type

Long.

Attributes

Read-only.

See Also

1.8.2 Name property

Returns the name of a Field object.

Syntax

object.Name[=Object As String]

Type

String.

Attributes

Read/write.

Remarks

Object is an optional parameter that sets the name of the Field object.

1.8.3 Value property

Returns the value assigned to a Field object.

Syntax

object.Value

Type

Variant. Default value depends on the Type property.

Attributes

Read/write.

Remarks

String is an optional parameter that sets the name of the Field object.

1.8.4 Sample Script for Field and Fields Objects

This sample script retrieves the information about the employees from EMP table.

The sample does the following:

’Sample script for Fields collection and Fields object

On Error Resume Next

Set CN = CreateObject("UCX:NDODB.CONNECTION")
CN.Open ("DBTYPE=0;DATABASE=ORANW81.WORLD", "scott","Tiger")
Set RS = CN.Execute("Select * from emp", lRec)
Set FLDS = RS.Fields
RecValue = ""
PrintLine (25)
Print FLDS.Count

’ Print the values of the properties of the field object.
’
For FldCount = 1 To FLDS.Count
    Set FLD = FLDS.Item(FldCount)
    RecValue = RecValue & CStr(FLD.Name) & "/" &CStr(FLD.Value) & "/" & CStr(FLD.DefinedSize)
    Print RecValue
    RecValue = ""
Next
PrintLine (25)
CN.Close

’Subroutine to print a line
’
Sub PrintLine(Number)
    For PrintCount = 1 To Number
        Line = Line & "-"
    Next
    Print Line
End Sub