MakeList
This function executes a pass-through SQL ‘select’ statement against the database and converts the results into a scrolling list of items when used with App.ShowList.
Group: Database Related Extensions
Syntax:
sMyList = DB.MakeList(sSQL, [bRtnAllCols], [bNormalize], [bScale, nMaxRows)
sMyList (String) is the list to be returned for display (i.e., set RSP = Value to display the list on the Client device.)
sSQL (String) is the SQL 'SELECT' statement to be sent to the database.
bRtnAllCols (Boolean) Optional – when set to True will return all the columns as the potential key, not just the first column. Default is False.
bNormalize (Boolean) Optional – when set to True will trim the spaces from the data so that it will display consistently. Default is False.
bScale (Boolean) Optional – formats the numeric values in the specified column if the database does not store decimals. This option will position a decimal at a position from the right side. A comma will be used for large numbers. This field is locale specific and will use the appropriate characters for each region. Default is True.
nMaxRows (Long) Optional – limits how many rows will be allowed in the list. Default is 500.
Example:
Inside the OnEnter event where Rsp is declared as a String:
Dim sSQL As String
Dim sMyList As String
sSQL = "select PartNo from Inventory"
sMyList = DB.MakeList(sSQL, True, True, True, 1000)
Rsp = App.ShowList(sMyList)
Or
Rsp = App.ShowList(DB.MakeList(sSQL, True, True))