1.

How Do You Create A Datawindow Object Dynamically?

Answer»

We use SyntaxFromSQL() and Create() 

functions:

SQLCA.SyntaxFromSQL(select string, presentation string, Error string)
dw_1.Create(SYNTAX, Error string)
dw_1.SetTransObject(SQLCA)
dw_1.Rerieve()

To create a DataWindow dynamically we have to:

  1. build a string to hold a SQL Select statement;
  2. build a string to specify the presentation characteristics of the DataWindow object;
  3. ASSOCIATE the syntax and description with an existing DataWindow control;
  4. associate the DataWindow control with a transaction object, and perform a retrieval.

The DataWindow that is created exists only for the life of the DataWindow control, unless we use the LibraryImport() function to save it in a library. Dynamic DW objects allow US to create and modify DW objects on the fly. To create a DW dynamically, use the Create() function.

Creating takes two arguments: the NAME of the DataWindow object that will be replaced by the new DW object, and the syntax for creating the new DW object. We can create the DW object syntax in a script, but it is easier to use the SyntaxFromSQL() to generate the syntax from a SELECT statement.

We use SyntaxFromSQL() and Create() 

functions:

SQLCA.SyntaxFromSQL(select string, presentation string, Error string)
dw_1.Create(syntax, Error string)
dw_1.SetTransObject(SQLCA)
dw_1.Rerieve()

To create a DataWindow dynamically we have to:

The DataWindow that is created exists only for the life of the DataWindow control, unless we use the LibraryImport() function to save it in a library. Dynamic DW objects allow us to create and modify DW objects on the fly. To create a DW dynamically, use the Create() function.

Creating takes two arguments: the name of the DataWindow object that will be replaced by the new DW object, and the syntax for creating the new DW object. We can create the DW object syntax in a script, but it is easier to use the SyntaxFromSQL() to generate the syntax from a SELECT statement.



Discussion

No Comment Found