페이지 코드

5664 단어 페이지 코드
 

    :
<%''       :Pages.asp%>
<%''  ADO     adovbs.inc,  "\Program Files\Common Files\System\ADO"     %>
<!--#Include File="adovbs.inc"-->
<%''*       ,   Oracle8.05   
 Set conn=Server.CreateObject("ADODB.Connection") 
 conn.Open "Provider=msdaora.1;Data Source=YourSrcName;User ID=YourUserID;Password=YourPassword;" 

 Set rs=Server.CreateObject("ADODB.Recordset")  ''  Recordset  
 rs.CursorLocation=adUseClient          ''         
 ''*          ,          
 rs.PageSize=10                   
 
 ''*         
 StrSQL="Select ID,  ,  ,   from     Order By ID"    
 rs.Open StrSQL,conn,adOpenStatic,adLockReadOnly,adCmdText
%>
<HTML>
<HEAD>
<title>    </title>
<script language=javascript>
 //  "[   ]"   :
 function PageFirst()
 { 
  document.MyForm.CurrentPage.selectedIndex=0;
  document.MyForm.CurrentPage.onchange();
 }
 //  "[   ]"   :
 function PagePrior()
 {  
  document.MyForm.CurrentPage.selectedIndex--;
  document.MyForm.CurrentPage.onchange();
 }
 //  "[   ]"   :
 function PageNext()
 { 
  document.MyForm.CurrentPage.selectedIndex++;
  document.MyForm.CurrentPage.onchange();     
 }
 //  "[    ]"   :
 function PageLast()
 { 
  document.MyForm.CurrentPage.selectedIndex=document.MyForm.CurrentPage.length-1;
  document.MyForm.CurrentPage.onchange();
 }
 //  " ? "   :
 function PageCurrent()
 { //Pages.asp        
  document.MyForm.action='Pages.asp?Page='+(document.MyForm.CurrentPage.selectedIndex+1)
  document.MyForm.submit();
 } 
</Script>
</HEAD>
<BODY bgcolor="#ffffcc" link="#008000" vlink="#008000" alink="#FF0000"">
 
<%IF rs.Eof THEN
  Response.Write("<font size=2 color=#000080>[        !]</font>")
 ELSE 
  ''      
  If Request("CurrentPage")="" Then
   rs.AbsolutePage=1
  Else
   rs.AbsolutePage=CLng(Request("CurrentPage"))
  End If 
  
  ''    MyForm,   Get
  Response.Write("<form method=Get name=MyForm>") 
  Response.Write("<p align=center><font size=2 color=#008000>")
  ''       
  if rs.PageCount=1 then 
   Response.Write("[   ] [   ] [   ] [    ] ")
  else 
    if rs.AbsolutePage=1 then
     Response.Write("[   ] [   ] ")
     Response.Write("[<a href=javascript:PageNext()>   </a>] ") 
     Response.Write("[<a href=javascript:PageLast()>    </a>] ") 
    else 
      if rs.AbsolutePage=rs.PageCount then
       Response.Write("[<a href=javascript:PageFirst()>   </a>] ") 
       Response.Write("[<a href=javascript:PagePrior()>   </a>] ") 
       Response.Write("[   ] [    ] ")
      else
        Response.Write("[<a href=javascript:PageFirst()>   </a>] ") 
        Response.Write("[<a href=javascript:PagePrior()>   </a>] ") 
        Response.Write("[<a href=javascript:PageNext()>   </a>] ") 
        Response.Write("[<a href=javascript:PageLast()>    </a>] ") 
      end if
    end if
  end if
  
  ''       ,        
  Response.Write(" <select size=1 name=CurrentPage onchange=PageCurrent()>")  
  For i=1 to rs.PageCount 
   if rs.AbsolutePage=i then
    Response.Write("<option selected>"&i&"</option>") ''    
   else
    Response.Write("<option>"&i&"</option>")
   end if 
  Next 
  Response.Write("</select> / "&rs.PageCount&"   "&rs.RecordCount&"   </font><p>") 
  Response.Write("</form>")
  
  ''    ,    
  Response.Write("<table align=center cellspacing=1 cellpadding=1 border=1")  
  Response.Write(" bordercolor=#99CCFF bordercolordark=#b0e0e6 bordercolorlight=#000066>")
  
  Response.Write("<tr bgcolor=#ccccff bordercolor=#000066>") 
   
  Set Columns=rs.Fields 
  
  ''    
  For i=0 to Columns.Count-1
   Response.Write("<td align=center width=200 height=13>")
   Response.Write("<font size=2><b>"&Columns(i).name&"</b></font></td>") 
  Next
  Response.Write("</tr>")
  ''    
  For i=1 to rs.PageSize 
   Response.Write("<tr bgcolor=#99ccff bordercolor=#000066>") 
   For j=0 to Columns.Count-1 
    Response.Write("<td><font size=2>"&Columns(j)&"</font></td>") 
   Next
   Response.Write("</tr>")
   
   rs.movenext 
   if rs.EOF then exit for 
  Next
  
  Response.Write("</table>") 

 END IF
%>
</BODY>
</HTML>

좋은 웹페이지 즐겨찾기