首页 > 开发 > 综合 > 正文

一个显示Grid的VBScript对象

2024-07-21 02:24:43
字体:
来源:转载
供稿:网友

商业源码热门下载www.html.org.cn

是根据ms提供的代码修改而成,目前还不支持编辑,可以排序、查询、分页显示
<%@ 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 ("模式错误——只允许使用view和edit<br>")
        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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表