This method returns a collection that can be populated with values you can pass to the ExecuteSQLStatement method as the parameters to send to a stored procedure or you can pass to the GetValuesForField and GetValuesForParameter methods as the default values.

The collection has an AddItem method that expects two parameters: the name of the value object and the value to assign to it.

Syntax

GetValuesCollection() as Object

Return Value
A collection to hold value objects.

Example
This example is taken from the end of an example in the Select help topic. It calls GetValuesCollection to create a values collection, adds two values to it, and then passes the collection to ExecuteSQLStatement to be used as the parameters for a stored procedure.

Visual FoxPro

if not empty(ldStartDate) and not empty(ldEndDate)
  loValues = toApplication.GetValuesCollection()
  loValues.AddItem('Beginning_Date', ldStartDate)
  loValues.AddItem('Ending_Date',    ldEndDate)

* Execute the desired stored procedure.

  lcSelect = 'exec [Sales by Year]'
  llReturn = not empty(toDatabase.ExecuteSQLStatement(lcSelect, ;
    loValues, tcCursor))
endif

See Also
Application Object