| Home | Previous Lesson: GetSQLSelect() and SetSQLSelect() Next Lesson: The DW Syntax Tool |
We've already seen how to use Modify() function to change most of the attributes of a DataWindow, and in the same way we can use it to change the SQL statements. The attribute you need to modify, in order to change the SQL statement, is table.select. For example:
String lArg1, lResult
lArg1 = "datawindow.table.select='select product_no, " + &
"product_description," + " product_balance from "+&
"product_master where product_balance < " + &
"product_reorder_leval'"
lResult = dwc_1.Modify( lArg1)
If lResult = "" Then
dwc_1.Retrieve()
Else
MessageBox( "Error in changing the SQL statement",lResult)
Return -1
End If
When Modify() is used, it doesn't check SQL statement against the database; this makes it faster, but obviously prone to errors.
We would recommend that you thoroughly test any SQL statements associated with this function.
| Home | Previous Lesson: GetSQLSelect() and SetSQLSelect() Next Lesson: The DW Syntax Tool |