asp代码写入数据库的最简单的具体步骤
首页 你直接复制我的吧
index.htm 需要一个表单页面.至于检查表单是否为空.这个你应该会吧? <body> <form id="form1" name="form1" method="post" action="Check.asp"> <label>用户名: <input type="text" name="username" /> </label> <p> <label> <input type="submit" name="Submit" value="提交" /> </label> </p> </form> </body> 然后一下连接数据库的页面 conn.asp <% dim ConnString set conn=server.CreateObject("adodb.connection") ConnString="provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("#shujuku.mdb") conn.open ConnString %> 然后一个记录到数据的页面 Check.asp <!--#include file="conn.asp"--> <% set rs=server.createobject("adodb.recordset") rs.open "select * from xieru",conn,1,3 rs.addnew rs("name")=request.form("username") rs.update rs.close set rs=nothing response.Redirect "indexof.html" '这句是转向 三个文件放在同一文件夹下面 如果IIS里面可以运行.但是不能写入的话.应该是权限的问题.你设置一下数据库所在的文件夹的权限.. |
|