ASP页面标题,显示成新闻标题那样,如下面rs2("code")显示的内容,我时小白,请直接贴出如何更改,谢谢

2025-02-24 18:23:26
推荐回答(2个)
回答1:


//这个是连接数据库的应该在第一行


<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from company"
rs.open sql,conn,1,3
%>
<%=rs("新文字段名")%>
其它的正常写就可以了.

回答2:

<%

set rs=server.CreateObject("adodb.recordset")
sql="select * from company"
rs.open sql,conn,1,3
%>






<%=rs("company")%>

<%
dim id,prename,company,intro,predate,graph2,description,remarks,price,rs2,strSorts,strCategory,YourPrice
'id=SafeRequest("id",1)
id=request.QueryString("id")

set rs2=server.CreateObject("adodb.recordset")
rs2.open "select * from product where id="&id,conn,1,3
if rs2.eof and rs2.bof then
response.Write ""
response.End
end if
rs2("viewnum")=rs2("viewnum")+1
rs2.update
IntCatID = rs2("categoryid")
IntCatIDLong=IntCatID

set rs=server.CreateObject("adodb.recordset")
do while not IntCatID = 0
rs.open "Select categoryid,category,ParentID From category Where categoryid="&IntCatID,conn,1,1

if rs.eof and rs.bof then
response.Write ""
rs.close
set rs = Nothing
conn.Close
set conn=nothing
response.end
end if

strCategory = ""&rs("category")&">>"&strCategory
TitleCategory = TitleCategory&""&rs("category")&">>"
IntCatID = rs("ParentID")
IntCatIDLong=CStr(IntCatIDLong)&","&CStr(rs("ParentID"))
rs.close
loop
set rs = nothing
%>




Product: <%=rs2("name")%>


Model: <%=rs2("code")%>