|
<%
If Session("name")="" Then
Response.Redirect "Login.asp"
End if
%>
<%
dim id,addtime
ID=request("checkid")
addtime=date()
dim rstemp,rsadd,rsdel
dim tname,title,tel
dim main
dim mobile
dim department
dim email,office
set rstemp=server.createobject("adodb.recordset")
set rsadd=server.createobject("adodb.recordset")
set rsdel=server.createobject("adodb.recordset")
Dim conn
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\text\database\text.mdb"
sqltemp="select * from 论文信息"
rstemp.Open sqltemp,conn,1,1
if rstemp.EOF or rstemp.BOF then
response.write "<script language=JavaScript>" & chr(13) & "alert('这本图书已售完!');" & "history.back()" & "</script>"
else
tname=rstemp("tname")
title=rstemp("title")
tel=rstemp("tel")
main=rstemp("main")
mobile=rstemp("mobile")
department=rstemp("department")
email=rstemp("email")
office=rstemp("office")
sql="insert into list(tname,title,name,tel,main,mobile,department,email,office,addtime) values('"&tname&"','"&title&"','"&session("name")&"','"&tel&"','"&main&"','"&mobile&"','"&department&"','"&email&"','"&office&"','"&addtime&"')"
rsadd.open sql,conn,1,1
set rsdel=server.createobject("adodb.recordset")
sql="delete from 论文信息 where title in (select title from list)"
rsdel.open sql,conn,3,4
response.write "<script language=JavaScript>" & chr(13) & "alert('课程已添加!');" & "history.back()" & "</script>"
set rstemp=nothing
set rsadd=nothing
set rsdel=nothing
set conn=nothing
end if
%>
我的代码是这样写的 能添加 但删除不了 |
|