<a href="del.asp?delid=<%=rs("dogid")%>">shanchu</a>这么写是错的吗?
添加代码<ahref="del.asp?delid=<%=rs("dogid")%>">shanchu</a>想设置个删除按钮,用来删除该行记录<%setconn=Ser...
添加代码
<a href="del.asp?delid=<%=rs("dogid")%>">shanchu</a>想设置个删除按钮,用来删除该行记录
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.open "provider=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;pwd=ccjiee;DATABASE=dog"
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT * FROM dogarticle", conn
strsql="insert into dogarticle (dogid,title,article,del) VALUES ('"&request.Form("dogid")&"','"&request.Form("title")&"','"&request.Form("article")&"','<a href="del.asp?delid=<%=rs("dogid")%>">shanchu</a>')"
conn.execute strsql
conn.close
set conn=nothing
response.write "yes"
%> 展开
<a href="del.asp?delid=<%=rs("dogid")%>">shanchu</a>想设置个删除按钮,用来删除该行记录
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.open "provider=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;pwd=ccjiee;DATABASE=dog"
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT * FROM dogarticle", conn
strsql="insert into dogarticle (dogid,title,article,del) VALUES ('"&request.Form("dogid")&"','"&request.Form("title")&"','"&request.Form("article")&"','<a href="del.asp?delid=<%=rs("dogid")%>">shanchu</a>')"
conn.execute strsql
conn.close
set conn=nothing
response.write "yes"
%> 展开
1个回答
展开全部
strsql="insert into dogarticle (dogid,title,article,del) VALUES ('"&request.Form("dogid")&"','"&request.Form("title")&"','"&request.Form("article")&"','<a href="del.asp?delid=<%=rs("dogid")%>">shanchu</a>')"
改为
strsql="insert into dogarticle (dogid,title,article,del) VALUES ('" & request.Form("dogid") & "','" & request.Form("title") & "','" & request.Form("article") & "','<a href=""del.asp?delid=" & rs("dogid") & """>shanchu</a>')"
改为
strsql="insert into dogarticle (dogid,title,article,del) VALUES ('" & request.Form("dogid") & "','" & request.Form("title") & "','" & request.Form("article") & "','<a href=""del.asp?delid=" & rs("dogid") & """>shanchu</a>')"
追问
非常感谢, "','shanchu')",问下连续三个双引号那个地方,第一个是和最后一个双引号对应,一个是href链接双引号对应,还有一个双引号是什么意思呢?
追答
VB类语言(包括ASP中的VBScript)如果要在一个字符串中包含双引号,则用两个双引号表示,如:
s = "My Name Is ""HeHeHe"""
则 s 的实际值为 My Name Is "HeHeHe"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询