connection.asp
<%
<HTML>
<HEAD>
</HEAD><BODY><!-- 请在这里输入您的HTML代码 --><%
dim connstr
connstr ="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db1.mdb")
dim conn
set conn=Server.CreateObject("adodb.connection")
conn.Open connstr%>
</BODY></HTML><%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
<!--#include file="connection.asp"--><%
strBookID = request.QueryString("BookID")'response.Write(strBookID) 可以得到strBookID的值Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "delete from books"
strSQL = strSQL&"where BookID="&Trim(strBookID)
rs.open strSQL ,conn, 1,3
rs.delete
rs.update
rs.close
conn.close
response.Redirect("index.asp")%>
<body>
</body>
</html>
<%
<HTML>
<HEAD>
</HEAD><BODY><!-- 请在这里输入您的HTML代码 --><%
dim connstr
connstr ="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db1.mdb")
dim conn
set conn=Server.CreateObject("adodb.connection")
conn.Open connstr%>
</BODY></HTML><%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
<!--#include file="connection.asp"--><%
strBookID = request.QueryString("BookID")'response.Write(strBookID) 可以得到strBookID的值Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "delete from books"
strSQL = strSQL&"where BookID="&Trim(strBookID)
rs.open strSQL ,conn, 1,3
rs.delete
rs.update
rs.close
conn.close
response.Redirect("index.asp")%>
<body>
</body>
</html>
解决方案 »
- OFFICE2007下如何使vb另存为 xls 2003
- vb 6 工程的文件保存后被无故删除
- 100分:COMBO1.TEXT="" 出现错误,并提示 text为只读属性 是怎么回事。
- 关于findwindow和getwindowthreadprocessid的问题!
- Set rs = CreateObject("adodb.recordset") 的应用
- 怎样学好数据结构(请赐教)
- 请问一个sql语句写法
- 【交流】学VB的朋友们.过来一下.自己的做了个网站内有学习VB的资料5K篇.同时找人交换一下友情连接 ^_^
- 有请"超级绿豆"讲解一下《实用代码:简单的分隔条类》的思路!
- 用vb做的ocx控件嵌入到asp里,能与asp传递变量吗?怎样传?请指教,多谢?
- 关于Unrar.dll解压rar文件的几个问题,有兴趣的进
- VB问题求助啊
strSQL = strSQL & " where BookID=" & Trim(strBookID)
2,如果BookID为字符型,则:
strSQL = "delete from books "
strSQL = strSQL & " where BookID='" & Trim(strBookID) & "'"