This topic provides step-by-step instructions for creating a data-displaying control and binding it via a ProBindingSource object to an ABL query. The exercise assumes you want your UI to include a data grid that displays the name, city, and state of all customers in the sports2000 database who live in Texas.
To begin, make sure that you have you have configured both an ABL connection and a SQL connection to the sports2000 database, and that the database is connected to your project. Also make sure that the DB Structure view is open (if not, select ).
DEFINE VAR qh AS HANDLE NO-UNDO. CONSTRUCTOR PUBLIC Form1 ( ): SUPER(). InitializeComponent ( ). CREATE QUERY qh. qh:SET-BUFFERS(BUFFER Customer:HANDLE). qh:QUERY-PREPARE("FOR EACH customer where customer.state = 'TX'"). qh:QUERY-OPEN (). proBindingSource1:handle= qh. END CONSTRUCTOR. DESTRUCTOR Form1 ( ): IF VALID-HANDLE(qh) THEN DO: qh:QUERY-CLOSE(). DELETE OBJECT qh. END. END DESTRUCTOR.