A column of data with a common data type.
Indicates the defined size of a Field object.
object.DefinedSize
Long.
Read-only.
Returns the name of a Field object.
object.Name[=Object As String]
String.
Read/write.
Object is an optional parameter that sets the name of the Field object.
Returns the value assigned to a Field object.
object.Value
Variant. Default value depends on the Type property.
Read/write.
String is an optional parameter that sets the name of the Field object.
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