熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp添加數據庫記錄

2022-06-13   來源: .NET編程 

  asp教程添加數據庫教程記錄
<form name="form" method="post" action="">
  <label>
  <input name="uid" type="text" id="uid">
  </label>
  用戶名
  <p>
    <label>
    <input name="pwd" type="text" id="pwd">
    </label>
  密碼
  <input type="hidden" name="action" value="add">
  </p>
  <p>
    <label>
    <input type="submit" name="Submit" value="增加">
    </label>
  </p>
</form>
<%
   asp添加數據庫記錄
  Dpath ="wwwliannet/dbaseMateyDBWeb_^%$#@mdb"
  Set Conn=ServerCreateObject("Adodbconnection")
 
  if requestQueryString("action")="add" then
   Set Rs =ServerCreateObject("AdodbRecordset")
   Connconnectionstring="Provider=MicrosoftJetoledb;Data source="&ServerMapPath(Dpath)
   Connopen
   Dim sql
  
   sql ="select * from test "
   rsopen sqlconn
   rsaddnew
    rs("uid")=request("uid")
  rs("pwd")=request("pwd")
   rsupdate
   responseWrite("數據保存成功")
  end if
 
  %>


From:http://tw.wingwit.com/Article/program/net/201311/14279.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.