6 49 1 VB Example

LANSA Open Guide

6.49.1 VB Example

Dim iRet As Integer, iRecords As Integer, iCount As Integer, _

         sBuff As String, lFlags As Long 

 

iRet = LceSetSelectOptions(iSession, "*BACKWARDS,  *MAXREC25")

iRet = LceRequestSelect(iSession, "SURNAME, SALARY", "PSLMST", _ 

       "", FALSE)

iRet = LceReceiveSelect(iSession, "PSLMST")

iRet = LceGetRecordCount(iSession, "PSLMST", iRecords)

sBuff = space(256, chr(0))

For iCount=1 to iRecords

         iRet = LceGetSelect(iSession, "PSLMST", iCount, "SURNAME")

         iRet = LceGetFieldValueX(iSession, "SURNAME", sBuff, lFlags)

         lstNames.AddItem  sTrim (sBuff)

         lstNames.ItemData (lstNames.NewIndex) = iCount

Next