Using DataWindowSyntaxFromSql

You are likely to use DataWindowSyntaxFromSql to create the syntax for most dynamic DataWindow objects. If you use DataWindowSyntaxFromSql, all you have to do is provide the SELECT statement and the presentation style.

DataWindowSyntaxFromSql is a method of the DataWindowSyntaxGenerator object and takes a Transaction or AdoTransaction object as a parameter. The transaction object must be connected when you call the method.

DatWindowSyntaxFromSql is overloaded. It has two required arguments:

If you do not specify a third argument or the third argument is null, DataWindowSyntaxFromSql creates a DataWindow object with the Tabular presentation style. You can specify one of two third arguments:

DataWindowSyntaxFromSql returns the complete syntax for a DataWindow object that is built using the specified SELECT statement.

If your DBMS is Adaptive Server and you call DataWindowSyntaxFromSql, the DataWindow server must determine whether the tables are updatable through a unique index. This is possible only if you set AutoCommit to true before calling DataWindowSyntaxFromSql, as shown here for a Transaction object called myTrans:

myTrans.AutoCommit=true
DWSyntaxGenerator.DataWindowSyntaxFromSql (myTrans,
   sqlstmt, stylestr)
myTrans.AutoCommit=false