Object-oriented ASP Programming VI-table for automatically displaying a recordset

Source: Internet
Author: User
<script Language=jscript runat=server>
// ************************************************************************
Script Compont Object Model
Design for Active Server Pages
//
Copyright 2003 Version 1.0
Made by Ying Guang
// ************************************************************************
Used to display data from a recordset, you can specify colors and styles
interface functions
function Createjdblist () {
var objjdblist=new jdblist
Objjdblist.create ()
Return objjdblist
}
Class Body Definition
function Jdblist () {

This. Adorecordset

This. Width
This. Border
This. CellSpacing
This. cellpadding
This. Class
This. Titleclass

This. Firstcolor
This. Secondcolor
This.create=_jdblist_create
This.display=_jdblist_display
}
method to implement
function _jdblist_create () {

This. Adorecordset= ""

This. Width= "100%"
This. Border= "1"
This. cellspacing= "0"
This. cellpadding= "1"
This. Class= ""

This. Titleclass= '

This. Firstcolor= '
This. Secondcolor= '
}
function _jdblist_display () {
var htmldso = ';
var nfields = this. AdoRecordSet.Fields.Count;
if (nfields)
{
var n = 0;
Htmldso + = ' < ' + ' table width= ' +this. width+ ' "id=" ' +this. Id+ ' "cellspacing=" ' +this. cellspacing+ ' "cellpadding=" ' +this. cellpadding+ ' "border=" ' +this. border+ ' "class=" ' +this. class+ ' > ';

Htmldso + + ' < ' + ' tr> ';
for (Var i=0 i < Nfields; i++)
{
Htmldso + = ' < ' + ' TD class= ' +this. Titleclass+ ' > ' + this. Adorecordset (i). Name + ' < ' + '/td> ';
}
Htmldso + + ' < ' + '/tr> ';

if (!) ( This. Adorecordset.eof&&this. ADORECORDSET.BOF))

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.