asp 修改信息 数据库不改变
dimcondimconstrsetcon=server.CreateObject("adodb.connection")constr="DRIVER={SQLServe...
dim con
dim constr
set con=server.CreateObject("adodb.connection")
constr="DRIVER={SQL Server};UID=sa; PWD=19921008dwj;database=dsjk;server=F3XZSCOHQCAVRYD;"
con.open constr
uname1=session("uname1")
uname=request("uname")
yx=request("yx")
flag=request("flag")
sql="select uname,yx from zc where uname='"&uname1&"'"
set rs=con.execute(sql,,adCMDText)
if flag="" then
else
'if uname<>""or yx<>"" then
if uname<>"" then
sql="update zc set uname='"&uname&"' where uname='"&uname1&"'"
con.execute sql,,adCMDText
ok=ture
end if
if yx<>"" then
sql="update zc set yx='"&yx&"' where uname='"&uname1&"'"
con.execute sql,,adCMDText
ok=ture
end if
end if
%>
<body>
<table width="500" height="200" align="center">
<tr><td colspan="2" align="center">修改</td></tr>
<tr><td width="118">用户名</td>
<td width="184"><input type="text" name="uname" value=" <%=rs("uname")%>"/></td>
</tr>
<td>邮箱</td>
<td><input name="yx" type="text" id="yx" value=" <%=rs("yx")%>"/></td>
</tr>
<tr><td colspan="2" align="center">
<input name="submit" type="submit" style="height:37px; width:190px; background-color:#FC0; border-style:none; font-size:18px; background-image: url(login4.jpg);" value="修改" />
</label></td>
</tr>
<input type="hidden" name="flag" id="flag" value="false" /></td>
</table>
</form>
</body>
</html> 展开
dim constr
set con=server.CreateObject("adodb.connection")
constr="DRIVER={SQL Server};UID=sa; PWD=19921008dwj;database=dsjk;server=F3XZSCOHQCAVRYD;"
con.open constr
uname1=session("uname1")
uname=request("uname")
yx=request("yx")
flag=request("flag")
sql="select uname,yx from zc where uname='"&uname1&"'"
set rs=con.execute(sql,,adCMDText)
if flag="" then
else
'if uname<>""or yx<>"" then
if uname<>"" then
sql="update zc set uname='"&uname&"' where uname='"&uname1&"'"
con.execute sql,,adCMDText
ok=ture
end if
if yx<>"" then
sql="update zc set yx='"&yx&"' where uname='"&uname1&"'"
con.execute sql,,adCMDText
ok=ture
end if
end if
%>
<body>
<table width="500" height="200" align="center">
<tr><td colspan="2" align="center">修改</td></tr>
<tr><td width="118">用户名</td>
<td width="184"><input type="text" name="uname" value=" <%=rs("uname")%>"/></td>
</tr>
<td>邮箱</td>
<td><input name="yx" type="text" id="yx" value=" <%=rs("yx")%>"/></td>
</tr>
<tr><td colspan="2" align="center">
<input name="submit" type="submit" style="height:37px; width:190px; background-color:#FC0; border-style:none; font-size:18px; background-image: url(login4.jpg);" value="修改" />
</label></td>
</tr>
<input type="hidden" name="flag" id="flag" value="false" /></td>
</table>
</form>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询