このメソッドは、フィールドリスト内のフィールド名のコピーを取得します。
LCFieldlist
fieldName = fldList. GetName (index)
パラメータ |
説明 |
---|---|
index |
Long、1 から fldLst.FieldCount の範囲。 フィールドリスト内のフィールドの位置です。 |
値 |
説明 |
---|---|
fieldName |
String 型。フィールドの名前を返します。 |
Option Public
Uselsx "*lsxlc"
Sub Initialize
Dim connect As New LCConnection ("db2")
Dim FldLst As New LCFieldlist
Dim field As LCField
Dim i As Long
' this section assigns the appropriate properties to connect to DB2
connect.Database = "Gold"
connect.Userid = "JDoe"
connect.Password = "xyzzy"
connect.Metadata = "customer"
connect.Connect
' now perform the catalog action - in this case for fields
If (connect.Select (Nothing, 1, FldLst) = 0) Then
Print "The customer table was not found."
Else
Print "There are " & FldLst.FieldCount & _
" columns in the '" & connect.Metadata & "' table."
Print "They are:"
For i = 1 To FldLst.FieldCount
Print Tab(4); FldLst.GetName (i)
Next
End If
End Sub
There are 7 columns in the 'customer' table.
They are:
ACCOUNTMANAGER
CONTACTNAME
COMPANYNAME
COMPANYADDRESS
COMPANYCITY
COMPANYSTATE
COMPANYPHONE