JavaScript Editor js editor     Web development 



Main Page

File: ...\Samples\Solution\Forms\Makesql.scx

This sample shows how to make it possible for a user to build a custom query at run time. Combo boxes on the form make it possible for a user to choose fields from the currently open table. The BldSQL method processes the names of the fields and the values users type into text boxes to create an executable SQL SELECT statement.

Additional methods, ValidateType and SetTextboxFormat, make sure that the appropriate values are entered into the text boxes and correctly incorporated into the SELECT statement.

After the WHERE clause has been constructed and stored to the variable lcWhere, the following command creates the SELECT statement:

В Copy Code
lcSQL = "SELECT * FROM " + lcAlias + " " + lcWHERE

Once the SELECT statement is constructed, it can be executed with macro substitution.

В Copy Code
&lcSQL

See Also



JavaScript Editor js editor     Web development