aizjcn 发表于 2002-6-29 21:39:42

ASP通用库添加数据

废话不多少,用于和我一样的懒虫.
<!--#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>"
%>

OurHF 发表于 2002-12-9 20:41:22

希望能进行一下缩进~

:)
页: [1]
查看完整版本: ASP通用库添加数据