A VBScript object that displays the grid

Source: Internet
Author: User
Vbscript| Object | The display is based on the code modified by MS, currently does not support editing, you can sort, query, pagination display
<%@ Language=vbscript%>
<% Option Explicit%>
<%
Class Classdatagrid

Private M_strsql
Private M_strconn
Private M_strrowcolor1
Private M_strrowcolor2
Private M_strmode
Private M_strprocesspage

Private M_strtitle
Private M_strrsname
Private M_strfindfields

Public Property Get SQL ()
SQL = M_strsql
End Property

Public Property Let SQL (strSQL)
M_strsql = strSQL
End Property

Public Property Get Conn ()
Conn = M_strconn
End Property

Public Property Let Conn (strconn)
M_strconn = strconn
End Property

Public Property Get RowColor1 ()
If IsNull (M_strrowcolor1) Or Len (M_strrowcolor1) = 0 Then
RowColor1 = "#ffffff"
Else
RowColor1 = M_strrowcolor1
End If
End Property

Public Property Let RowColor1 (StrRowColor1)
M_strrowcolor1 = StrRowColor1
End Property

Public Property Get RowColor2 ()
If IsNull (M_strrowcolor2) Or Len (M_strrowcolor2) = 0 Then
RowColor2 = "#00ffff"
Else
RowColor2 = M_strrowcolor2
End If
End Property

Public Property Let RowColor2 (StrRowColor2)
M_strrowcolor2 = StrRowColor2
End Property

Public Property Get Mode ()
If IsNull (M_strmode) Or Len (M_strmode) = 0 Then
Mode = "View"
Else
Mode = M_strmode
End If
End Property

Public Property Let Mode (Strmode)
If strmode <> "View" and Strmode <> "Edit" Then
Response.Write ("mode error--View and edit<br> only allowed")
Response.End
Else
M_strmode = Strmode
End If
End Property

Public Property Get Processpage ()
Processpage = M_strprocesspage
End Property

Public Property Let Processpage (Strprocesspage)
M_strprocesspage = Strprocesspage
End Property

Public Property Get Title ()
If IsNull (m_strtitle) Or Len (m_strtitle) = 0 Then
Title = "Data Grid"
Else
Title = M_strtitle
End If
End Property

Public Property Let Title (Strtitle)
M_strtitle = Strtitle
End Property

Public Property Get Rsname ()
If IsNull (m_strrsname) Or Len (m_strrsname) = 0 Then
Rsname = "Grid"
Else
Rsname = M_strrsname
End If
End Property

Public Property Let Rsname (Strrsname)
M_strrsname = Strrsname
End Property

Public Property Get Findfields ()
Findfields = M_strfindfields
End Property

Public Property Let Findfields (Strfindfields)
M_strfindfields = Strfindfields
End Property

Sub Showdatagrid ()

Dim Intpagenum
Dim objconn
Dim objRS
Dim Intabs
Dim Intcurrentpage
Dim Intfindcol
Dim intpagesize
Dim introw
Dim Intcol
Dim I
Dim intpos
Dim intdisplayrows
Dim StrSort
Dim Strsortdir
Dim Strlastsort
Dim Strlastsortdir
Dim Strcolor
Dim Strfind
Dim Boolfind
Dim Boolfound



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.