Using retrieval arguments

About retrieval arguments

Retrieval arguments qualify the SELECT statement associated with the DataWindow object, reducing the rows retrieved according to some criteria. For example, in the following SELECT statement, Salary is a retrieval argument defined in DataWindow Designer:

SELECT Name, emp.sal FROM Employee 
   WHERE emp.sal > :Salary

When you call the Retrieve method, you supply a value for Salary. The code to retrieve the names and salaries of employees whose salary exceeds 50,000 looks like this in Visual Basic:

dwEmp.Retrieve(50000)

When coding Retrieve with arguments, specify them in the order in which they are defined in the DataWindow object. Your Retrieve method can provide more arguments than a particular DataWindow object expects. Any extra arguments are ignored. This allows you to write a generic Retrieve that works with several different DataWindow objects. You can specify any number of retrieval arguments.

Omitting retrieval arguments

If your DataWindow object takes retrieval arguments but you do not pass them in the Retrieve method, the DataWindowControl prompts the user for them when Retrieve is called. In a Web application, you must provide your own mechanism for user-entered retrieval arguments.