asp+access做个程序要有添加删除修改源代码谢谢 有的话 发我邮箱 120703290@qq.com

用asp做好的 里面包含access表 有 注册模块 登录模块 修改 删除模块 添加模块
最简单的就行 学生实训作业 不需要什么后台运作

一、login

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理员登录页面</title>
<script type="text/javascript">
function chkFrm(){
if (form1.uid.value==""){
alert("管理员帐号不能为空,请重新输入!");
form1.uid.focus();
return false;
}
if (form1.pwd.value==""){
alert("管理员密码不能为空,请重新输入!");
form1.pwd.focus();
return false;
}
}
</script>
</head>

<body>
<table width="463" height="219" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<form name="form1" id="form1" action="check.asp" method="post" onsubmit="return chkFrm();">
<tr>
<td height="31" colspan="2" bordercolor="#000000" bgcolor="#3399FF"><div align="center">管理员登录页面--</div></td>
</tr>
<tr>
<td width="154" height="76" bordercolor="#000000" bgcolor="#FFFF99"><div align="right">账号:</div></td>
<td width="303" bordercolor="#000000" bgcolor="#FFFF99"><div align="left">
<input name="uid" type="text" id="uid" />
</div></td>
</tr>
<tr>
<td height="85" bordercolor="#000000" bgcolor="#FFFF99"><div align="right">密码:</div></td>
<td bordercolor="#000000" bgcolor="#FFFF99"><div align="left">
<input name="pwd" type="password" id="pwd" />
</div></td>
</tr>
<tr>
<td height="25" colspan="2" bordercolor="#000000" bgcolor="#66FFFF"><div align="center">
<input type="submit" name="Submit" value="登录" />
</div></td>
</tr>
</form>
</table>
</body>
</html>

二、check.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../conn.asp"-->
<%
dim uid ,pwd
uid=trim(Request.Form("uid"))
pwd=trim(Request.Form("pwd"))
'response.write uid
'response.End()
set rs=getmdb("select * from admin where UserName='"&uid&"' and PassWord='"&pwd&"'")
'查找数据库,检查用户名是否存在
if rs.recordcount>=1 then
session("adminok")=true
Response.Redirect "user_check.asp"
else
Response.Redirect "messagebox.asp?msg=您输入了错误的帐号或口令,请再次输入!"
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>验证页面</title>
</head>

<body>
</body>
</html>

三、user_check.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../conn.asp"-->
<%
page=cint(request("page"))
set rs=getmdb("select * from user")
'dim MaxPerPage
'MaxPerPage=20
' 假如没有数据时
If rs.eof and rs.bof then
'call showpages
response.write "<p align='center'><font color='#ff0000'>还没任何用户资料</font></p>"
response.end
End if
' 取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
'dim text,checkpage
text="0123456789"
Rs.PageSize=2 'MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
' 分页定位页面
If Page<1 Then Page=1
If Page>rs.PageCount Then Page=rs.PageCount
rs.AbsolutePage=page
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户审核页面</title>
<script type="text/javascript">
function doDel(id,page){
if(confirm("真的要删除这个用户?"))
window.location.href="del_user.asp?ID="+id+"&page="+page
}
</script>
</head>

<body>
<table width="1020" height="200" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<form action="<%=Myself%>" method="post">
<tr>
<td colspan="7" bordercolor="#000000" bgcolor="#0066FF"><div align="center">用户审查</div></td>
</tr>
<tr>
<td width="127" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center">编号</div></td>
<td width="127" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center">账号</div></td>
<td width="127" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center">姓名</div></td>
<td width="251" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center">电子信箱</div></td>
<td width="190" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center">联系电话</div></td>
<td colspan="2" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center">操作</div></td>
</tr>
<%
'Dim rs
'Set rs=Getmdb("SELECT * FROM admin")
For iPage=1 To rs.PageSize
' 在表格中显示会员信息
%>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="center"><%=rs("ID")%></div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="center"><%=rs("uid")%></div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="center"><%=rs("name")%></div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="center"><%=rs("email")%></div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="center"><%=rs("phone")%></div></td>
<td width="82" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center"><a href="user_check_1.asp?id=<%=rs("ID")%>">修改</a></div></td>
<td width="100" bordercolor="#000000" bgcolor="#FFFFCC"><div align="center"><a href="javascript:doDel(<%=rs("ID")%>,<%=page%>)">删除</a></div></td>
</tr>
<%
rs.movenext
If rs.EOF Then Exit For
next
' 为跳转页面设置链接
%>
<tr>
<td colspan="7" bordercolor="#000000" bgcolor="#00FFFF"><div align="center">
<p ALIGN="center">
<%If Page<>1 Then ' 如果不是位于第一页%>
<a href="<%=Myself%>?Page=1">首页</a>
<a HREF="<%=Myself%>?Page=<%=(Page-1)%>">上页</a>
<%
End If
If Page<>rs.PageCount Then ' 如果不是位于最后一页
%>
<a HREF="<%=Myself%>?Page=<%=(Page+1)%>">下页</a>
<a HREF="<%=Myself%>?Page=<%=rs.PageCount%>">末页</a>
<% End If %>
 输入页次:<input name="Page" size="1">页次:<%=Page%>/<%=rs.PageCount%>共有<%=rs.recordcount%>条记录</div></td>
</tr>
</form>
</table>
</body>
</html>

四、user_check_1.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../conn.asp"-->
<%
id=request("ID")
'uid=request.Form("uid")
set rs=getmdb("select * from user where ID="&id)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户信息修改页</title>
</head>

<body>
<table width="604" height="536" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<form name="form1" id="form1" action="user_check_1_ok.asp?ID=<%=id%>" method="post" >
<tr>
<td colspan="2" bordercolor="#000000" bgcolor="#0066FF"><div align="center">新用户注册--</div></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">您的会员账号:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input name="uid" type="text" id="uid" value="<%=rs("uid")%>" readonly="1" />
</div></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">您的姓名:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input type="text" name="name" id="name" value="<%=rs("name")%>" />
</div></td>
</tr>

<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">密码提问:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input type="text" name="question" id="question" value="<%=rs("question")%>" />
</div></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">提问回答:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input type="text" name="answer" id="answer" value="<%=rs("answer")%>" />
</div></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">E_mail:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input type="text" name="email" id="email" value="<%=rs("email")%>" />
</div></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">常用电话:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input type="text" name="phone" id="phone" value="<%=rs("phone")%>" />
</div></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">家庭住址:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input type="text" name="address" id="address" value="<%=rs("address")%>" />
</div></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="right">邮编:</div></td>
<td bordercolor="#000000" bgcolor="#FFFFCC"><div align="left">
<input type="text" name="zip" id="zip" value="<%=rs("zip")%>" />
</div></td>
</tr>

<tr>
<td colspan="2" bordercolor="#000000" bgcolor="#00CCFF"><div align="center">
<input type="submit" name="submit" id="submit" value="修改成功" />
</div></td>
</tr>
</form>
</table>
</body>
</html>

五、user_check_1_ok.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../conn.asp"-->
<%
id=request("ID")
set rs=getmdb("select * from user where ID="&id)
'更新管理员密码到数据库
'rs("uid")=request.form("uid")
rs("name")=request.form("name")
rs("question")=request.form("question")
rs("answer")=request.form("answer")
rs("email")=request.form("email")
rs("phone")=request.form("phone")
rs("address")=request.form("address")
rs("zip")=request.form("zip")
rs.update
rs.close
response.redirect "user_check_1.asp?ID="&id
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>把修改写进数据库页面</title>
</head>

<body>
</body>
</html>

六、del_user.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp"-->
<%
'if request.cookies("adminok")="" then
'response.redirect "Shop_login.html"
'end if
CurrentPage=request("Page")
contentID=request("ID")
set rs=getmdb("delete from user where ID="&contentID)
set rs=nothing
response.redirect "user_check.asp?page="&CurrentPage
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>删除页面</title>
</head>

<body>
</body>
</html>

七、conn.asp

<%
function getmdb(sql)
Dim cn,rs
set cn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
on error resume next
connstr="driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("/data/test.mdb")
cn.open connstr
rs.open sql,cn,3,2
set getmdb=rs
end function
%>

八、剩下的数据库的名叫test.mdb 把这个数据库放在一个叫data 的文件夹下就行了
温馨提示:内容为网友见解,仅供参考
第1个回答  2011-01-06
把邮箱给我,我 给你发过去。421157076@qq.com本回答被提问者采纳

asp+access做个程序要有添加删除修改源代码谢谢 有的话 发我邮箱 12070...
<a href="user_check_1.asp?id=<%=rs("ID")%>">修改 <a href="javascript:doDel(<%=rs("ID")%>,<%=page%>)">删除 <% rs.movenext If rs.EOF Then Exit For next ' 为跳转页面设置链接 %> <%If Page<>1

相似回答