LSX - Print LCFieldList Fields Properties (Length, Datatype, etc.)

Mindwatering Incorporated

Author: Tripp W Black

Created: 09/29/2003 at 09:08 AM

 

Category:
Notes Developer Tips
LSX (LotusScript Extensions/Connectors)

From the Lotus Connector LSX Help Database - (But try finding it without a full-text search...)

Option Public
Uselsx "*lsxlc" // DECS only, see overview in this chapter for LEI syntax.
Sub Initialize
Dim connect As New LCConnection ("db2") //For LEI syntax, see overview.
Dim FldLst As New LCFieldlist
Dim pos As Long
Dim dtype As Long
Dim flags As Long
Dim fieldname As String
REM this section assigns the appropriate properties to connect to DB2
connect.Database = "Gold"
connect.Userid = "JDoe"
connect.Password = "xyzzy"
connect.Metadata = "customer"
REM connect to DB2
connect.Connect
REM 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 "The table description is:"
pos = LCLIST_FIRST
While (FldLst.List (pos, , , dtype, flags, fieldname) = True)
Print " " + fieldname + " is type #" +_
Cstr(dtype) + " with flags " + Hex(flags)
pos = LCLIST_NEXT
Wend
End If
End Sub

previous page