|
楼主 |
发表于 2006-8-31 22:26:18
|
显示全部楼层
不能上传附件
大概是这样的。
classmate:
name sex borndate phone policy address company Email
以前只会静态的,想提高一下能力。
这是另一页的代码,也放上来吧:
<%
name1=request("text1")
sex=request("sell")
borndate=request("text2")
phone=request("text3")
policy=request("text4")
address=request("text5")
company=request("text6")
Email=request("text7")
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;"&
"Data Source="& Server.MapPath("classmate.mdb")
Conn.Open
set rs=server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
sql="select * from classmate where 姓名='"& name1"'"
rs.Open sql,conn,1,1
if rs.EOF or rs.bof then
rs1.Open"classmate",conn,1,2
rs1.addnew array("姓名","性别","出生日期","电话","手机","住址","单位","Email"),
array(name1,sex,borndate,phone,policy,address,company,Email)
%>
<script language="vbscript">
alert("信息添加成功!!!")
window.location.href="index.asp"
</script>
<%
rs1.close
set rs1=nothing
else
%>
<script language="vbscript">
alert("此同学以添加!")
history.back
</script>
<%
end if
rs.Close
set rs=nothing
%>
[ 本帖最后由 ellva 于 2006-9-4 17:31 编辑 ] |
|