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

asp添加數據庫記錄

2013-11-13 10:40:38  來源: .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-2013 電腦知識網 Computer Knowledge   All rights reserved.