本人最近在维护一个asp做的网站,里面有段代码如下:
<%
sql="select a.id,a.title,b.projectId from tblIBBemail a" & _
" inner join tblibbautoemailcategory b on a.id = b.emailid" & _
" order by b.projectid,a.Title"
set rec=server.createobject("ADODB.Recordset")
rec.open sql, conn, 3, 3
if not rec.eof then
do until rec.eof
stitle = rec("title")
stitle = replace(stitle,"&","&")
stitle = replace(stitle,"'","'")
stitle = replace(stitle,"""",""")
response.write "" & chr(10)
rec.movenext
loop
end if
%>
<xml >
<%
sql="select a.id,a.title,b.projectId from tblIBBemail a" & _
" inner join tblibbautoemailcategory b on a.id = b.emailid" & _
" order by b.projectid,a.Title"
set rec=server.createobject("ADODB.Recordset")
rec.open sql, conn, 3, 3
if not rec.eof then
do until rec.eof
stitle = rec("title")
stitle = replace(stitle,"&","&")
stitle = replace(stitle,"'","'")
stitle = replace(stitle,"""",""")
response.write "" & chr(10)
rec.movenext
loop
end if
%>
<%
sql="select a.id,a.title,b.projectId from tblIBBemail a" & _
" inner join tblibbautoemailcategory b on a.id = b.emailid" & _
" order by b.projectid,a.Title"
set rec=server.createobject("ADODB.Recordset")
rec.open sql, conn, 3, 3
if not rec.eof then
do until rec.eof
stitle = rec("title")
stitle = replace(stitle,"&","&")
stitle = replace(stitle,"'","'")
stitle = replace(stitle,"""",""")
response.write "" & chr(10)
rec.movenext
loop
end if
%>