RAD Studio
ContentsIndex
PreviousUpNext
Using database information in responses
Name 
Description 
Console CGI applications are launched in response to HTTP request messages. When working with databases in these types of applications, you can use the default session to manage your database connections, because each request message has its own instance of the application. Each instance of the application has its own distinct, default session.
When writing an ISAPI application or an NSAPI application, however, each request message is handled in a separate thread of a single application instance. To prevent the database connections from different threads from interfering with each other, you must give each thread its own session.
Each request... more 
You can embed the HTML table that represents your dataset in a larger document by using the Header and Footer properties of the table producer. Use Header to specify everything that comes before the table, and Footer to specify everything that comes after the table.
You may want to use another content producer (such as a page producer) to create the values for the Header and Footer properties.
If you embed your table in a larger document, you may want to add a caption to the table. Use the Caption and CaptionAlignment properties to give your table a caption. 
Specialized Content producer components on the Internet palette page supply HTML commands based on the records of a dataset. There are two types of data-aware content producers:  
If you know the dataset for the table at design time, you can use the Columns editor to customize the columns' field bindings and display attributes. Select the table producer component, and right-click. From the context menu, choose the Columns editor. This lets you add, delete, or rearrange the columns in the table. You can set the field bindings and display properties of individual columns in the Object Inspector after selecting them in the Columns editor.
If you are getting the name of the dataset from the HTTP request message, you can't bind the fields in the Columns editor at... more 
Similar to the table attributes, you can specify the alignment and background color of cells in the rows of the table that display data. The RowAttributes property is a THTMLTableRowAttributes object.
At design time, specify these properties using the Object Inspector by expanding the RowAttributes property. You can also specify these properties programmatically at runtime.
You can also adjust the number of rows shown in the HTML table by setting the MaxRows property. 
Table producers use the THTMLTableAttributes object to describe the visual appearance of the HTML table that displays the records from the dataset. The THTMLTableAttributes object includes properties for the table's width and spacing within the HTML document, and for its background color, border thickness, cell padding, and cell spacing. These properties are all turned into options on the HTML <TABLE> tag created by the table producer.
At design time, specify these properties using the Object Inspector. Select the table producer object in the Object Inspector and expand the TableAttributes property to access the display properties of the THTMLTableAttributes object.... more 
Dataset page producers work like other page producer components: they convert a template that includes HTML-transparent tags into a final HTML representation. They include the special ability, however, of converting tags that have a tag name which matches the name of a field in a dataset into the current value of that field. For more information about using page producers in general, see Using page producer components.
To use a dataset page producer, add a TDataSetPageProducer component to your Web module and set its DataSet property to the dataset whose field values should be displayed in the HTML content.... more 
The response to an HTTP request message may include information taken from a database. Specialized content producers on the Internet palette page can generate the HTML to represent the records from a database in an HTML table.
To return database information in an HTTP response, you would typically As an alternate approach, special components on the InternetExpress category of the Tool palette let you build Web servers that are part of a multi-tiered database application. See Building Web applications using InternetExpress for details. 
TDataSetTableProducer is a table producer that creates an HTML table for a dataset. Set the DataSet property of TDataSetTableProducer to specify the dataset that contains the records you want to display. You do not set the DataSource property, as you would for most data-aware objects in a conventional database application. This is because TDataSetTableProducer generates its own data source internally.
You can set the value of DataSet at design time if your Web application always displays records from the same dataset. You must set the DataSet property at runtime if you are basing the dataset on the information in the... more 
You can produce an HTML table to display the results of a query, where the parameters of the query come from the HTTP request message. Specify the TQuery object that uses those parameters as the Query property of a TQueryTableProducer component.
If the request message is a GET request, the parameters of the query come from the Query fields of the URL that was given as the target of the HTTP request message. If the request message is a POST request, the parameters of the query come from the content of the request message.
When you call the Content method... more 
The Internet palette page includes two components that create an HTML table to represent the records of a dataset:
  • Dataset table producers, which format the fields of a dataset into the text of an HTML document.
  • Query table producers, which runs a query after setting parameters supplied by the request message and formats the resulting dataset as an HTML table.
Using either of the two table producers, you can customize the appearance of a resulting HTML table by specifying properties for the table's color, border, separator thickness, and so on. To set the properties of a table producer... more 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!