xml文件中怎么调数据库?用asp

来源:百度知道 编辑:UC知道 时间:2024/06/30 09:00:48
一个xml文件:代码我改过后如下:
<?xml version="1.0" encoding="utf-8"?>

<jpgrotator>
<photos>
<%
dim conn,db
dim connstr
db="Databases/##aeshitou.asp" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
%>
<%
id=session("id")
set rs=server.CreateObject("Adodb.recordset")
'sql="select * from product where id=58"
sql="select * from product where id="&id
rs.open sql,conn,3,3
%>
<%if rs("DefaultPicUrl")="../img/nopic.gif" then%><%e

LZ写得没有错啊。放到服务器上报什么错呢?

不过我建议都这样写
<%
Response.Write "<?xml version=""1.0"" encoding=""utf-8""?> "
............
%>

到底想干什么?