read6.asp html 표현

    Front-end/ASP / / 2020. 5. 13. 11:45

    order the list(ol)로 표현

    <html>
    <body>
    
    <% 
    
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionString = "DSN=win.dsn"
    
    Conn.Open
    
    Set Rs = Server.CreateObject("ADODB.Recordset")
    Rs.Open "Select * From tblCategories Where CategoryID='2';", Conn
    %>
    
    <ol>
    <li><%= Rs("CategoryID") %></li>
    <li><%= Rs("CategoryName") %></li>
    <li><%= Rs("Description") %></li>
    </ol>
    
    <%
    Rs.close
    set Rs=nothing
    Conn.close
    Set Conn=nothing
    %>
    
    
    </body>
    </html>

    www.read6.asp

    1. 2
    2. Condiments
    3. Sweet and savory sauces, relishes, spreads, and seasonings

    read6.asp 테이블 표현

    <html>
    <body>
    
    <% 
    
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionString = "DSN=win.dsn"
    
    Conn.Open
    
    Set Rs = Server.CreateObject("ADODB.Recordset")
    Rs.Open "Select * From tblCategories Where CategoryID='2';", Conn
    %>
    
    <table border="3" bordercolor="orange">
    
     <tr>
       <td><%= Rs("CategoryID") %></td>
     </tr>
    
     <tr>
       <td><%= Rs("CategoryName") %></td>
     </tr>
    
     <tr>
       <td><%= Rs("Description") %></td>
     </tr>
    
    </table>
    
    
    
    <%
    Rs.close
    set Rs=nothing
    Conn.close
    Set Conn=nothing
    %>
    
    
    </body>
    </html>
    2
    Condiments
    Sweet and savory sauces, relishes, spreads, and seasonings

     

    read6.asp 테이블 표현 caption 생성 - 5번째 줄 불러오기

    <html>
    <body>
    
    <% 
    
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionString = "DSN=win.dsn"
    
    Conn.Open
    
    Set Rs = Server.CreateObject("ADODB.Recordset")
    Rs.Open "Select * From tblCategories Where CategoryID='5';", Conn
    %>
    
    <table border="3" bordercolor="orange">
    
    
    <tr>
       <td> DB Contents </td>
     </tr>
    
     <tr>
       <td><%= Rs("CategoryID") %></td>
     </tr>
    
     <tr>
       <td><%= Rs("CategoryName") %></td>
     </tr>
    
     <tr>
       <td><%= Rs("Description") %></td>
     </tr>
    
    </table>
    
    
    
    <%
    Rs.close
    set Rs=nothing
    Conn.close
    Set Conn=nothing
    %>
    
    
    </body>
    </html>

    read1.asp (테이블 형식)

    <html>
    
    <head>
    <title>Contents</title>
    </head>
    
    <body bgcolor="#FFFFFF">
    
    <p><big><big>Categories</big></big> </p>
    
    <hr size="1" align="left">
    <% 
    
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionString = "DSN=win.dsn"
    Conn.Open
    Set Rs = Server.CreateObject("ADODB.Recordset")
    
    Rs.Open "Select * From tblCategories", Conn
    
    %>
    
    <table border="1" width="670">
        <tr bgcolor="gray">
            <td width="155" height="11">
                <p><b>Category ID</b></p>
            </td>
            <td width="159" height="11">
                <p><b>Category Name</b></p>
            </td>
            <td width="334" height="11">
                <p><b>Description</b></p>
            </td>
        </tr>
    
    <%
    while not Rs.eof
    %>
    
        <tr>
            <td width="155" height="3">
                <p><%=Rs("CategoryID")%></p>
            </td>
            <td width="159" height="3">
                <p><%=Rs("CategoryName")%></p>
            </td>
            <td width="334" height="3">
                <p><%=Rs("Description")%></p>
            </td>
        </tr>
    
    <% 
    Rs.movenext
    Wend
    Rs.close
    set Rs=nothing
    Conn.close
    Set Conn=nothing
    %>
    
    </table>
    
    <p align="left"><strong>SQL:</strong> <font face="Times New Roman" size="3" color="#000000">Select *
    From
    tablename</font></p>
    
    <p align="left"><a href="main.asp">Main</a></p>
    </body>
    </html>

    read7  5-13 과제 hr 반복문 while

    <html>
    
    <head>
    <title>Contents</title>
    </head>
    
    
    
    <hr size="1" align="left">
    <% 
    
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionString = "DSN=win.dsn"
    Conn.Open
    Set Rs = Server.CreateObject("ADODB.Recordset")
    
    Rs.Open "Select * From tblCategories", Conn
    
    %>
    
    
    <%
    while not Rs.eof
    %>
    
          <ul>
              <li>  <%=Rs("CategoryID")%></li>     
               <li> <%=Rs("CategoryName")%></li>
               <li> <%=Rs("Description")%></li>
           </ul>
           <hr>
    
    <% 
    Rs.movenext
    Wend
    Rs.close
    set Rs=nothing
    Conn.close
    Set Conn=nothing
    %>
    
    
    
    </body>
    </html>

     

    • 네이버 블러그 공유하기
    • 네이버 밴드에 공유하기
    • 페이스북 공유하기
    • 카카오스토리 공유하기
    loading