asp编程高手帮忙解释下这段代码,谢谢...

来源:百度知道 编辑:UC知道 时间:2024/05/14 03:53:43
各位大哥们,看看下面这段,能不能详细解释下,偶菜.

该模块中用到了response对象,可以利用它将脚本语言结果输出到浏览器上,用来将信息发送给浏览器。
<li><a href="admintheme.asp?topic=<%response.Write (theme&cstr (rec ("count ")))%>">
<%response.Write(rec("topic"))%></a>

<a href="admintheme.asp?topic =<%response.Write(theme&cstr (rec(" count ")))%>"修改</a>

<a href="admindel.asp?topic=<%response.Write(theme&cstr(rec("count")))%>">删除</a><%bb=cstr(request("topic"))
top=left(bb,1)
cou=cint(mid(bb,2,len(bb)-1))
filepath="Driver={Microsoft Access Driver (*.mdb)};dbq="&server.MapPath("hardware.mdb")
set conn=server.createobject("adodb.connection")
conn.open filepath
conn.execute("delete from ware where count="&cou&"")
response.Redirect("admintopic.asp?theme="&top&"

前面应该有一个名为rec的数据库连接,<%response.Write (theme&cstr (rec ("count ")))%>"> 这句就是输出theme变量的值,再输出数据库中count键直,CStr是vbscript的字符串转换函数,把一个变量转换成字符串。
后面都是到修改和删除的链接,不解释了。
bb=cstr(request("topic")) 这句,是接收传入的topic变量,经一系列变量运算。后面再次连接数据库,删除数据库中count为cou的一行,就这些吧
最后一行是重定向