sql="select * from ad_user_music where user_music_id="&id
Set rs= Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
if not rs.eof and not rs.bof then
rs("user_music_mn")=mn
rs("user_music_class"=musicclass
rs("user_music_url")=url
rs("user_music_music")=un
rs("user_music_say")=say
rs("user_music_lrc")=lrc
rs("user_music_pic")=pic
rs("user_music_updt")=now()
rs("user_music_upip")=getIP
rs.update()
end if
rs.close()
set rs=nothing
sql="select * froma d_music_class where user_music_id="&musicid
"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.eof and not rs.bof then
rs("user_music_mn")=musicmn
rs("user_music_class"=musicclass
...
rs.update() '这一句非常重要,就是更新这条记录
end if
rs.close()
set rs=nothing
%>
以上是第二种方法,这两种方法更有好处,一般要是只是更新一条记录,可用第一种方法,如果又想得到记录,并且绑定到文本框上或者其他什么地方,同时又想更新记录,就用第二种方法。作者: 清茶淡水 时间: 2010-1-10 01:25
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/ip.asp"-->
<%
id=session("musicid")
mn=request("musicname")
musicclass=request("musicclass")
url=request("musicurl")
un=request("musicun")
say=request("say")
lrc=request("lrc")
pic=request("musicpic")
sql="select * from ad_user_music where user_music_id="&id
Set rs= Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
if not rs.eof and not rs.bof then
rs("user_music_mn")=mn
rs("user_music_class"=musicclass
rs("user_music_url")=url
rs("user_music_music")=un
rs("user_music_say")=say
rs("user_music_lrc")=lrc
rs("user_music_pic")=pic
rs("user_music_updt")=now()
rs("user_music_upip")=getIP
rs.update()
end if
rs.close()
set rs=nothing