write1.asp

    html

    <html>
    <body>
    
    <form method="post" action="write2.asp">
    <table border="2">
    
    <caption>
    
    </caption>
      <tr>
         <td>Category ID:</td>
         <td><input type="text" name="txtCID" size="47"</td>
      </tr>
    
     <tr>
         <td>Category Name:</td>
         <td><input type="text" name="txtCName" size="47"</td>
      </tr>
     
      <tr>
         <td>Description:</td>
         <td><input type="text" name="txtDesc" size="47"</td>
       </tr>
    
    
      <tr>
         <td></td>
         <td><input type="submit" name="btnsubmit" value="Submit"></td>
      </tr>
    </table>
    </form>
    </body>
    </html>

    write2.asp

    데이터 처리하는 파일 (쓰기)

    <html>
    <body>
    
    <%
    
    X1 = Request.Form("txtCID")
    X2 = Request.Form("txtCName")
    X3 = Request.Form("txtDesc")
    
    
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionString = "DSN=win.dsn"
    
    Conn.Open
    
    SQL = "INSERT INTO tblCategories (CategoryID, CategoryName, Description) VALUES ('"&X1&"','"&X2&"','"&X3&"')"
    Conn.Execute SQL
    
    
    Conn.close
    Set Conn=nothing
    %>
    
    Sussessfully Inserted
    </body>
    </html>
    
    
    • 네이버 블러그 공유하기
    • 네이버 밴드에 공유하기
    • 페이스북 공유하기
    • 카카오스토리 공유하기
    loading