Asp常用代码
来源:互联网 发布:数控铣床五角星编程 编辑:程序博客网 时间:2024/04/29 14:51
=============================== 删除 ==================================
if request("dels")="dels" then
Set delfile = conn.Execute("select * from [agad] where id="& request("id"))
on error resume next
if (IsNull(delfile("upfile")) = false and delfile("upfile") <> "") then
set fs1 = Server.CreateObject("Scripting.FileSystemObject")
fs1.deletefile(server.mappath("../"&delfile("upfile")))
set fs1 = nothing
end if
delfile.close
set delfile=nothing
sql="delete [agad] where id="&request("id")
conn.execute sql
response.Redirect(request.ServerVariables("HTTP_REFERER"))
end if
=========================== 删除提示 ==================================
<a href="product.asp?dels=dels&id=<%=rs("id")%>" onClick="javascript:if(confirm('您确认此操作吗?')){return true;}else{return false;}">删除</a>
=========================== 常用查询代码 ==================================
set rs=server.CreateObject("adodb.recordset")
sql="delete from product where id="&id&" ORDER BY ID DESC"
rs.open sql,conn,3,3
========================== 瑞腾数据库查询 =============================
select p.*,c3.fd_pcname,c4.* from tb_products p,tb_productcatalog4 c4,tb_productcatalog3 c3 where p.fd_companyID=11534 and p.fd_pc4ID=c4.fd_pcID and c4.fd_pcupid=c3.fd_pcid and c3.fd_pcid=606 and c3.fd_pcupID=67
========================== 图片显示 ===================================
<% if rs("upfile")<>"" or isnull(rs("upfile"))=true then %>
<a href="<%=rs("upfile")%>" target="_blank"><img src="<%=rs("upfile")%>" alt="<%=rs("name")%>" width="100" height="75" border="0" style="background-color: #003366"></a>
<% else %>
<img src="images/none.gif" width="100" height="75">
<% end if %>
========================== 会员退出 ================================
if request("exit")="exit" then
response.Expires=-9999
session.Abandon()
response.Redirect("index.asp")
end if
=========================== 生成随机数 =================================
Randomize
suis=Int(Rnd()*(9999-1000+1))+1000
=========================== 删除、添加、修改图片 =======================
id=getContent("id")
name=getContent("name")
content=getContent("content")
links=getContent("links")
kind=getContent("kind")
if id="" then
sql="insert into [agad](name,content,links,kind,upfile) values('"& name &"','"& content &"','"& links &"','"& kind &"','"& uploadfloder &"/"& fileName &"')"
else
Set delfile = conn.Execute("select * from [agad] where id="&id)
on error resume next
if (IsNull(delfile("upfile")) = false and delfile("upfile") <> "") then
set fs1 = Server.CreateObject("Scripting.FileSystemObject")
fs1.deletefile(server.mappath("../"&delfile("upfile")))
set fs1 = nothing
end if
delfile.close
set delfile=nothing
sql="update [agad] set name='"& name &"',content='"& content &"',links='"& links &"',kind='"& kind &"',upfile='"& uploadfloder &"/"& fileName &"' where id="& id
end if
conn.execute (sql)
response.Redirect("agad.asp?main=main")
response.end
- ASP初学者常用代码
- Asp常用代码
- 初学者常用ASP代码
- ASP常用代码收藏
- asp常用代码
- asp常用代码2
- ASP常用代码剪辑
- ASP常用代码
- 常用asp代码
- [转]常用ASP代码
- Asp常用代码
- ASP常用代码剪辑
- ASP常用代码
- ASP常用代码
- asp常用代码1
- ASP常用代码2
- ASP.NET常用代码
- asp.net常用代码
- 利用C#制作一个仿IE地址栏的文本框
- JAVA与正则表达式(2年级之1) Z
- JAVA与正则表达式(2年级2) Z
- Java & regex(2-3)
- JSP的MD5程序!
- Asp常用代码
- MD5 JAVA处理类
- 数据源JAVA连接类
- Java正则表达式详解[转载]
- JAVA正则表达式4种常用功能
- 今天买了新的LCD显示器
- SQLServer和Oracle的常用函数对比 Z
- 好书的翻译
- SQL Server 函数 变量 语句