新手求教,希望能详细写,或者给个实例也行~
谢谢各位大大了^^作者: 牛牛 时间: 2010-1-7 02:08
我也需要作者: 紫色&飘蓝ぁ 时间: 2010-1-7 02:09
我刚写的一段代码,
你看一看了.
<!--#include file="pwd.asp"-->
<!--#include file=conn1.asp-->
<%
if request("action")="edit" then
id=request("id")
hb=request("hb")
hl=request("hl")
qsrq=request("qsrq")
tzrq=request("tzrq")
hb1=request("hb1")
hl1=request("hl1")
qsrq1=request("qsrq1")
sql="update hbhl set hl="&hl1&",qsrq="&qsrq1&",tzrq="&qsrq&"where id="&id
conn1.execute sql
sql="select * from hbhl"
set rs=server.createObject("adodb.recordset")
rs.open sql,conn1,1,2
rs.addnew
rs("hb")=hb
rs("hl")=hl
rs("qsrq")=qsrq
rs("tzrq")=30000000
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>alert('修改成功!')</script>"
response.redirect "rate.asp"
end if
%>
<%
if request("action")="modify" then
id=request("id")
sql="select * from hbhl where id="&id
set rs=server.createObject("adodb.recordset")
rs.open sql,conn1,1,1
if not (rs.eof and rs.bof) then
%>
sql="update hbhl set hb='"&request("hb")&"',hl="&request("hl")&",qsrq="&request("qsrq")&",tzrq="&request("tzrq")&" where id="&id
conn1.execute(sql)
response.redirect "rate.asp"
end if
%>
<%
if request("action")="delsubmit" then
id=request("id")
sql="delete from hbhl where id="&id
conn1.execute(sql)
response.redirect "rate.asp"
end if
%>
<%
set rs=server.CreateObject("ADODB.recordset")
set rs1=server.CreateObject("ADODB.recordset")
sql1="select * from hbhl order by id"
sql="select * from hbhl order by tzrq desc"
rs.open sql,conn1,1,1
rs1.open sql1,conn1,1,1
qsrq_old1=rs("qsrq")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>汇率修改</title>
<script java="javascript">
function check(){
var regex=/^\d(\.)^\d/;
var qsrq=document.form1.qsrq.value;
var qsrq_old='<%=qsrq_old1%>';
var hl=document.form1.hl.value;
var flag=false;