⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 通用数据库显示程序.htm

📁 较为详细的介绍了asp自定义的各种函数,方便asp的各种开发.
💻 HTM
📖 第 1 页 / 共 2 页
字号:
              cellspacing='0'><tr><form method='GET'>" 
              <BR>Response.Write "&lt;TD &gt; " 'width='50%' <BR>IF 
              SESSION("FLMENULBUP")&lt;&gt;"" THEN <BR>Response.Write 
              "当前栏目:&lt;A 
              HREF='FLMEN.ASP?MENULB="&amp;SESSION("FLMENULBUP")&amp;"'&gt;"&amp;MID(SESSION("FLMENULBUP"),4,200)&amp;"" 
              <BR>END IF <BR>IF SESSION("flmenulb")&lt;&gt; 
              SESSION("FLMENULBUP") THEN <BR>Response.Write " &gt;&gt; &lt;A 
              HREF='FLMEN.ASP?menulb="&amp;SESSION("FLMENULBUP")&amp;"&amp;LB="&amp;SESSION("flmenulb")&amp;"'&gt;"&amp;MID(SESSION("flmenulb"),4,200)&amp;"" 
              <BR>END IF <BR>Response.Write "&lt;/TD&gt;&lt;td align='right' 
              &gt;&lt;/td&gt;&lt;td align='right'&gt;&lt;table border='0' 
              cellspacing='0' cellpadding='0'&gt; " <BR>Response.Write 
              "&lt;tr&gt;&lt;td rowspan='2'&gt;&lt;img src='img/SEARCH.GIF' 
              width='50'&gt; &lt;/td&gt;" <BR>for i3=1 to i1-1 
              <BR>Response.Write "&lt;td&gt;"&amp;findr(i3)&amp;":&lt;/td&gt;" 
              <BR>next <BR>Response.Write "&lt;/tr&gt;&lt;tr&gt;" 
              '&lt;td&gt;&lt;/td&gt; <BR>for i2=1 to i1-1 <BR>Response.Write 
              "&lt;td&gt;&lt;input type='text' name='key_word"&amp;i2&amp;"' 
              size='8' value=''&gt;&lt;/td&gt;" <BR>next </P>
              <P>Response.Write "&lt;tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;td 
              width='20%'&gt; &lt;input type='checkbox' name='find_fr' 
              value='yes'&gt;精确 &lt;input type='submit' value='开始' 
              name='B_FIND'&gt;&lt;/td&gt;" <BR>Response.Write "&lt;/form&gt; 
              &lt;/tr&gt;&lt;/table&gt;" <BR>find_fr=request("find_fr") 
              <BR>TJ="" <BR>urllr="&amp;find_fr="&amp;find_fr <BR>findlrdisp="" 
              <BR>FOR I3=1 TO I1-1 <BR>TJ1=request("KEY_WORD"&amp;I3) 
              <BR>urllr=urllr&amp;"&amp;key_word"&amp;i3&amp;"="&amp;tj1 <BR>IF 
              TJ1=FINDR(I3) OR TJ1="" THEN <BR>TJ1="" <BR>ELSE <BR>if 
              find_fr&lt;&gt;"yes" then 
              <BR>findlrdisp=findlrdisp&amp;findr(i3)&amp;"包含“"&amp;TJ1&amp;"” " 
              <BR>tj1=" AND "&amp;findL(I3)&amp;" like '%"&amp;TRIM(TJ1)&amp;"%' 
              " <BR>else 
              <BR>findlrdisp=findlrdisp&amp;findr(i3)&amp;"是“"&amp;TJ1&amp;"” " 
              <BR>tj1=" AND "&amp;FINDL(I3)&amp;" = '"&amp;TRIM(TJ1)&amp;"' " 
              <BR>end if <BR>END IF <BR>TJ=TJ&amp;TJ1 <BR>IF TJ="" THEN 
              <BR>TOPSN=" TOP 300 " <BR>ELSE <BR>TOPSN="" <BR>END IF <BR>NEXT 
              </P>
              <P>dim fild(35),dispfil(35),dispfildlr <BR>dispfildlr="" <BR>i=1 
              <BR>dispfild1=dispfild1 <BR>do while instr(dispfild1,",")&lt;&gt;0 
              <BR>star=instr(dispfild1,",") <BR>fild(i)=left(dispfild1,star-1) 
              <BR>dispfil(i)=fild(i) <BR>if instr(fild(i),"&lt;")&lt;&gt;0 then 
              <BR>fildbak=fild(i) 
              <BR>fild(i)=left(fildbak,instr(fildbak,"&lt;")-1) 
              <BR>dispfil(i)=right(fildbak,len(fildbak)-instr(fildbak,"&lt;")) 
              <BR>end if <BR>dispfildlr=dispfildlr&amp;fild(i)&amp;"," 
              <BR>dispfild1=right(dispfild1,len(dispfild1)-star) <BR>i=i+1 
              <BR>loop <BR>dispfildlr=left(dispfildlr,len(dispfildlr)-1) 
              <BR>SQL="SELECT "&amp;topsn&amp;" id,"&amp;DISPFILDlr&amp;" FROM 
              "&amp;TAB&amp;" WHERE ID&lt;&gt;-1 "&amp;tj&amp;" order by -ID" 
              <BR>'Response.Write sql <BR>session("tabsql")=sql <BR>Set 
              rs=Server.CreateObject("ADODB.RecordSet") <BR>rs.Open sql,conn,1,3 
              <BR>if not rs.eof then <BR>pagesn=request("pagesn") <BR>if 
              pagesn&lt;=0 or pagesn="" then pagesn=1 <BR>rs.pagesize=pagen 
              <BR>pagezs=rs.pagecount <BR>IF cint(PAGESN)&gt;pagezs THEN 
              pagesn=PAGEZS <BR>zs=rs.recordcount <BR>page=(pagesn-1)*pagen 
              <BR>rs.move page,1 <BR>if findlrdisp&lt;&gt;"" then Response.Write 
              "经搜索,"&amp;findlrdisp&amp;"的记录如下:" <BR>Response.Write "&lt;table 
              border='0' width='90%'&gt;" <BR>if zs&gt;=300 and topsn&lt;&gt;"" 
              then <BR>Response.Write "&lt;tr&gt; &lt;form method='POST' 
              action='?"&amp;urllr&amp;"'&gt;&lt;td 
              width='54%'&gt;总数很多,当前显示前"&amp;ZS&amp;"条,分"&amp;PAGEZS&amp;"页,现在是第"&amp;PAGESN&amp;"页&lt;/td&gt;" 
              <BR>else <BR>Response.Write "&lt;tr&gt; &lt;form method='POST' 
              action='?"&amp;urllr&amp;"'&gt;&lt;td 
              width='54%'&gt;一共"&amp;ZS&amp;"条,分"&amp;PAGEZS&amp;"页,现在是第"&amp;PAGESN&amp;"页&lt;/td&gt;" 
              <BR>end if <BR>Response.Write "&lt;td width='11%' 
              align='center'&gt;&lt;a 
              href='?PAGESN="&amp;PAGESN-1&amp;urllr&amp;"'&gt;上一页&lt;/td&gt;" 
              <BR>Response.Write "&lt;td width='11%' align='center'&gt;&lt;a 
              href='?PAGESN="&amp;PAGESN+1&amp;urllr&amp;"'&gt;下一页&lt;/td&gt;" 
              <BR>Response.Write "&lt;td width='24%' ALIGN='RIGHT'&gt;跳转到第 " 
              <BR>Response.Write "&lt;input type='text' name='PAGESN' 
              size='2'&gt;页&lt;input type='submit' value='GO' 
              name='B1'&gt;&lt;/td&gt;&lt;/form&gt; " <BR>Response.Write 
              "&lt;/tr&gt;&lt;/table&gt; " <BR>if fh="H" THEN <BR>Response.Write 
              " &lt;table border='0' width='100%' cellspacing='1' 
              cellpadding='0'&gt;" <BR>Response.Write " &lt;tr bgcolor='#EDBAA5' 
              align='center'&gt; " <BR>for ii=1 to i-1 <BR>Response.Write 
              "&lt;td&gt;"&amp;dispFIL(ii)&amp;"&lt;/td&gt;" <BR>next 
              <BR>Response.Write "&lt;/tr&gt;" <BR>for iii=1 to pagen 
              <BR>Response.Write "&lt;tr bgcolor='#FFFAEE'&gt;" <BR>FOR II=1 TO 
              I-1 <BR>Response.Write 
              "&lt;td&gt;"&amp;RS(fild(II))&amp;"&lt;/td&gt;" <BR>NEXT 
              <BR>Response.Write "&lt;/tr&gt;" <BR>RS.MOVENEXT <BR>if rs.eof 
              then exit for <BR>next <BR>Response.Write "&lt;/table&gt;" 
              <BR>ELSE <BR>Response.Write " &lt;table border='0' width='100%' 
              cellspacing='1' cellpadding='0'&gt;" <BR>for iii=1 to pagen 
              <BR>FOR II=1 TO I-1 <BR>Response.Write "&lt;tr&gt;&lt;td 
              bgcolor='#EDBAA5' ALIGN='RIGHT' 
              WIDTH='20%'&gt;"&amp;dispFIL(ii)&amp;":&lt;/td&gt;&lt;td 
              bgcolor='#FFFAEE'&gt;"&amp;RS(fild(II))&amp;"&lt;/td&gt;&lt;/tr&gt;" 
              <BR>NEXT <BR>Response.Write "&lt;tr height='1'&gt;&lt;td 
              bgcolor='#CFBA9E' colspan='2' ALIGN='RIGHT' WIDTH='20%'&gt; 
              &lt;/td&gt;&lt;/tr&gt;" <BR>RS.MOVENEXT <BR>if rs.eof then exit 
              for <BR>next <BR>Response.Write "&lt;/table&gt;" <BR>END IF 
              <BR>rs.close <BR>Response.Write "&lt;table border='0' 
              width='90%'&gt;" <BR>if zs&gt;=300 and topsn&lt;&gt;"" then 
              <BR>Response.Write "&lt;tr&gt; &lt;form method='POST' 
              action='?"&amp;urllr&amp;"'&gt;&lt;td 
              width='54%'&gt;总数很多,当前显示前"&amp;ZS&amp;"条,分"&amp;PAGEZS&amp;"页,现在是第"&amp;PAGESN&amp;"页&lt;/td&gt;" 
              <BR>else <BR>Response.Write "&lt;tr&gt; &lt;form method='POST' 
              action='?"&amp;urllr&amp;"'&gt;&lt;td 
              width='54%'&gt;一共"&amp;ZS&amp;"条,分"&amp;PAGEZS&amp;"页,现在是第"&amp;PAGESN&amp;"页&lt;/td&gt;" 
              <BR>end if <BR>Response.Write "&lt;td width='11%' 
              align='center'&gt;&lt;a 
              href='?PAGESN="&amp;PAGESN-1&amp;urllr&amp;"'&gt;上一页&lt;/td&gt;" 
              <BR>Response.Write "&lt;td width='11%' align='center'&gt;&lt;a 
              href='?PAGESN="&amp;PAGESN+1&amp;urllr&amp;"'&gt;下一页&lt;/td&gt;" 
              <BR>Response.Write "&lt;td width='24%' ALIGN='RIGHT'&gt;跳转到第 " 
              <BR>Response.Write "&lt;input type='text' name='PAGESN' 
              size='2'&gt;页&lt;input type='submit' value='GO' 
              name='B1'&gt;&lt;/td&gt;&lt;/form&gt; " <BR>Response.Write 
              "&lt;/tr&gt;&lt;/table&gt; " <BR>else <BR>Response.Write 
              "没有找到合适的记录" <BR>end if <BR>if er() then <BR>tabdisp=False <BR>else 
              <BR>tabdisp=True <BR>end if <BR>END FUNCTION </P>
              <P>Function Er() '错误处理函数 <BR>If Err.Number = 0 Then <BR>Er = False 
              <BR>Else <BR>Err.Clear <BR>Er = True <BR>End If <BR>End Function 
              <BR>%&gt; </P>
              <P>终于看完函数了.... <BR>各位有点累,其实仔不仔细看都没有关系.反正只管调它就是了.下面举一个应用的例子. 
              <BR>首先, 我们把前面的函数就是&lt;%和%&gt;之间的部分保存到一个叫 TABDISP.ASP的文件中. 
              <BR>代码如下: <BR>显示一个职式名册表,表名: ZG <BR>有ID 姓名 职务 职称 TEL BP DZ(地址)几个字段. 
              </P>
              <P>&lt;% <BR>。。。。。。 <BR>连接数据库,此处略过,不写了。 <BR>%&gt; 
              <BR>&lt;!--#include file="TABDISP.asp"--&gt; <BR>&lt;% 
              <BR>DISP="姓名,职务,职称,TEL&lt;电话,BP&lt;传呼,DZ&lt;地址" 
              <BR>FIND="姓名&lt;姓名,职务&lt;职务,DZ&lt;地址" <BR>PAGEN="15" <BR>FH="H" 
              <BR>TAB="ZG" </P>
              <P>IF NOT TABDISP(TAB,DISP,FIND,PAGEN,FH) THEN <BR>response.write 
              "出现错误," <BR>END IF <BR>SET CONN=NOTHING <BR>%&gt; </P>
              <P>把上面的内容随便起个文件名,就一切OK. </P>
              <P><BR>范例程序及数据库http://www.zydn.net/xxlr.asp?id=1906 <BR>另外, 
              阿余的站www.zydn.net有不少好文章给大家.阿余也在站上随时准备和和朋友交流.阿余的EMAIL:COOLKK@21CN.COM 
              <BR>还有啊,软件世界竟然发了篇牛记的文章,说程序员工资太高,阿余在站上也放了个论坛,大家可以一起到阿余的站上去骂死那个家伙. 
              <BR><BR></P></BLOCKQUOTE></TD></TR>
        <TR>
          <TD class=p4 vAlign=top width="50%">
            <BLOCKQUOTE>原作者:阿余<BR>来 源:开发者俱乐部<BR>共有8969位读者阅读过此文<BR>【<A 
              href="http://bbs.aspsky.net/list.asp?boardid=1">发表评论</A>】 
            </BLOCKQUOTE></TD>
          <TD class=p4 vAlign=top width="50%">
            <P>
            <LI><FONT color=#0772b1>上篇文章</FONT>:<A 
            href="http://www.aspsky.net/article/list.asp?id=2648">利用 WSH 
            作定时工作流程</A> <BR>
            <LI><FONT color=#0772b1>下篇文章</FONT>:<A 
            href="http://www.aspsky.net/article/list.asp?id=2650">使用FSO按文件大小浏览文件目录并进行删除操作</A> 
            </LI></TD></TR>
        <TR>
          <TD bgColor=#297dff class=p4 height=20 width="50%"><FONT 
            color=#ceffff>&nbsp;→ 本周热门</FONT></TD>
          <TD bgColor=#297dff class=p4 width="50%"><FONT color=#ceffff>&nbsp;→ 
            相关文章</FONT></TD></TR>
        <TR>
          <TD bgColor=#586011 colSpan=2 height=1><SPACER type="block" 
            width="1"></TD></TR>
        <TR>
          <TD colSpan=2 height=7></TD></TR>
        <TR>
          <TD class=p4 vAlign=top width="50%">
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1510" 
            target=_top title="SQL Server 7.0 入门(一)">SQL Server 7.0 
            入门(...</A>[<FONT color=red>7239</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1540" 
            target=_top title=PHP4实际应用经验篇(1)>PHP4实际应用经验篇(1)</A>[<FONT 
            color=red>7135</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1536" 
            target=_top 
            title=无组件文件上传代码实例(支持多文件上传及文件和input域混合上传)>无组件文件上传代码实例(支持多文件上...</A>[<FONT 
            color=red>6029</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=2557" 
            target=_top title=树型结构在ASP中的简单解决>树型结构在ASP中的简单解决</A>[<FONT 
            color=red>5757</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1545" 
            target=_top title=PHP4实际应用经验篇(6)>PHP4实际应用经验篇(6)</A>[<FONT 
            color=red>5599</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=2563" 
            target=_top title=一个老个写的无组件上传>一个老个写的无组件上传</A>[<FONT 
            color=red>5013</FONT>]<BR>
            <LI><A href="http://www.aspsky.net/article/list.asp?id=1542" 
            target=_top title=PHP4实际应用经验篇(3)>PHP4实际应用经验篇(3)</A>[<FONT 
            color=red>4731</FONT>]<BR></LI></TD>
          <TD class=p4 vAlign=top width="50%">
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2649">通用数据库显示程序</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2450">一个数据库操作类的实例(二.Provider类)</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2449">一个数据库操作类的实例(一.Command类部分)</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2362">ASP.NET/Perl.NET 
            数据库访问例子</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2341">读取Access数据库表名实例</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2324">数据库正规化和设计技巧</A><BR>
            <LI><A 
            href="http://www.aspsky.net/article/list.asp?id=2309">利用ASP存取各种常用类型数据库(4)</A><BR></LI></TD></TR>
        <TR>
          <TD colSpan=2 height=7></TD></TR></TBODY></TABLE>
    <TD bgColor=#297dff width=1> </TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR>
    <TD bgColor=#297dff height=1><SPACER type="block" 
width="1"></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR>
    <TD align=middle height=30></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
  <TBODY>
  <TR>
    <TD align=middle class=p2 width="100%">
      <TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
        <TBODY>
        <TR>
          <TD align=middle class=p2 width="100%">
            <P align=center><A 
            href="http://www.aspsky.net/produce/index.asp">客户服务</A> -- <A 
            href="http://www.aspsky.net/aspads.asp">广告合作</A> -- <A 
            href="http://www.aspsky.net/about.asp">关于本站</A> -- <A 
            href="http://www.aspsky.net/tell.asp">联系方法</A><BR><BR>动网先锋版权所有 <FONT 
            face=Verdana, size=1 Arial, Helvetica, sans-serif>Copyright &copy; 
            2000-2001 <B>AspSky<FONT color=#cc0000>.Net</FONT></B>, All Rights 
            Reserved .</FONT> 
</P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -