查看: 2816|回复: 1
收起左侧

ASP通用库添加数据

[复制链接]
发表于 2002-6-29 21:39:42 | 显示全部楼层 |阅读模式
废话不多少,用于和我一样的懒虫.
<!--#include file=conn.asp-->
<%=trim(request("sql"))%>
<%=replace(trim(request("sqlwhere")),"'","")%>
<% if Request.Form("w").Count > 0 then%>
<%
ck=replace(trim(request("ck")),"'","")
sql=trim(request("sql"))
if ck<>"" then
sqlwhere=trim(request("sqlwhere"))
set rs = Server.CreateObject("ADODB.Recordset")
mapsql = "SELECT * FROM lanmu "&sqlwhere&""
%>
<%=mapsql%>
<%
rs.Open mapsql,conn,1,3
if ck="n" then
rs.AddNew
for i=1 to Request.Form("w").Count
rs(rs.fields(i).name)=Request.Form("w")(i)
next
rs.Update
else
for i = 1 to Request.Form("w").Count
rs(rs.fields(i).name)=Request.Form("w")(i)
next
rs.Update
end if
end if
if sql<>"" then
conn.execute=sql
end if
end if
Response.write "<script>history.go(-1)</script>"
%>
发表于 2002-12-9 20:41:22 | 显示全部楼层
希望能进行一下缩进~

:)
您需要登录后才可以回帖 登录 | 加入幸福家园

本版积分规则

快速回复 返回顶部 返回列表