Introduction to Database Forms with HTML - Recordset
(Page 2 of 4 )
Recordset is a name given to the result of a database query. There are other names for it, such as resultSet. This result is in the memory of the client's computer. For a language like C++, there are APIs, which link the database program (code to manipulate the data) to the database engine. These APIs have (produce) the recordset, which is accessed by the programming language (C++).
If we use JavaScript as the programming language, what recordset shall we use? JavaScript offers a two-dimensional array whose columns can be of different data types. The problem here is that the JavaScript two-dimensional array is not well developed. It does not have the properties and methods that classical recordsets have.
Perhaps we should use the HTML TABLE element. The HTML TABLE element has the properties and methods that classical recordsets have. But the HTML table and its content, by default, appears on the browser page, while the content of a classical recordset does not appear on the client's document window!
If you give the HTML Table the style property, display:none, it will not appear or occupy space on the browser's window. Seen as a recordset, the field data of a row of the TABLE element is the content of the TD element. This can be anything; it can be text, image, video or even sound. Other recordsets do not easily take (accept) non-text objects. The HTML TABLE element can be used as a recordset.
The HTML TABLE element as a recordset has the following advantages over classical recordsets:
It does not only have to be two-dimensional; it can be three, even four-dimensional. When it comes to dimensions, you can make it as complex as you want. However, I will not address that issue here; maybe in some other article.
In conjunction with HTML, you need very little code (JavaScript) to make its field value (video) appear on the browser window. With another type of recordset, in conjunction with Windows API, you need a lot of code (C++) to make the field value appear in the client's document's window. Note: studios use Windows API without you being conscious of it.
If you want, you can see the content of the recordset without using code. To achieve this, simply allow the HTML TABLE (recordset) with its default style of display:block; put it in a DIV element which has scroll bars. As you can see, you do not need JavaScript, C++, or Visual Basic.net to do this. There is no other type of recordset whose data values you can see in the documents window, just like that.
You can give the HTML TABLE recordset-field values (e.g. images) or the whole recordset, dynamic behavior using JavaScript.
For those of you who are not used to handling recordsets by hand, know that any good container can be used as a resultset. The C++ vector container, for example, can be used as a recordset in the C++ world. The HTML TABLE element is a container. It might not look like it, but it is.
If you are dealing with the Internet and you have a basic (or small) database program to write,
you can use HTML in place of a studio, for flexibility, and in place of Windows API for ease of work;
you can use JavaScript instead of C++ or Visual Basic or Perl, etc, for ease of work and because it is easily available. Its interpreter is with the browser - see below for explanation;
you can use the HTML TABLE element with the style property set to display:none, for Single-Row Forms (see below), or with the default style display:block for Tabular Forms (see below). HTML TABLE is easily available (in browsers).
This is simply an aspect of web development.
Next: Programming Language >>
More HTML Articles
More By Chrysanthus Forcha