[ |../../index.htm#lansa/srvgudba_0680.htm]
You are here:

6.19.1 VB Example

Private Sub lstSkills_Click()
 
    ' This subroutine sets the fields displayed to the details of the 
    ' list's currently selected skill    
 
    Dim iRet As Integer
    Dim sBuff As String
    Dim lFlags As Long
    Dim lDataLen As Long
    Dim fSQLNullEnab As Boolean
 
    iRet = LceGetFieldAttributes(iSession, "SKILDESC", lFlags)
    If (lFlags And LCE_FLDATTR_SQLNULL) Then
        fSQLNullEnab = True
    Else
        fSQLNullEnab = False
    End If
 
    iRet = LceSetFieldValue(iSession, "SKILCODE", txtCode.Text)
 
    If txtDesc.Text <> "" Then
        iRet = LceSetFieldValue(iSession, "SKILDESC", txtDesc.Text) 
    Else
        If fSQLNullEnab = True Then
            ' "" is not a null terminated string
            iRet = LceSetFieldValue(iSession, "SKILDESC", vbNullString)
        Else
            ' Display message to enter a valid description
            Exit Sub
        End If
    End If
 
   iRet = LceInsert(iSession, "SKILCODE,SKILDESC", "SKLTAB", LceFalse)
    End If
End Sub
 
[ |../../index.htm#lansa/srvgudba_0680.htm]