2 回答
TA贡献1851条经验 获得超3个赞
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Response.ContentType="application/xml"
Response.Charset="utf-8"
response.cachecontrol="no-cache"
response.addHeader "pragma","no-cache"
response.expires=-1
response.expiresAbsolute=now-1
db="file.mdb" '数据库路径,相对路径
set conn = server.CreateObject("adodb.connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
Response.Write("<?xml version=""1.0"" encoding=""utf-8""?>")
set rs=Server.CreateObject("adodb.recordset")
rs.open "SELECT * FROM [file]",conn,1,1
if rs.Eof and rs.Bof then
Response.Write("<vcaster>")
Response.Write ("<item item_url=""no file"" item_title=""no file"">")
Response.Write("</item>")
Response.Write ("</vcaster>")
else
Response.Write("<vcaster>")
do while Not rs.Eof
Response.Write ("<item item_url="""&rs("fileurl")&""" item_title="""&rs("name")&""">")
Response.Write("</item>")
if rs.Eof then
Exit do
End if
rs.MoveNext
Loop
Response.Write ("</vcaster>")
End if
rs.Close
Set rs=Nothing
conn.Close
Set conn=Nothing
%>
本回答被提问者和网友采纳
TA贡献1966条经验 获得超4个赞
SQL Syntax 1:
IFNULL( expression, replacement )
Parameters:
expression
Any expression of any type. This expression is check for NULL.
replacement
The return value if the expression is NULL.
Escape Syntax:
{fn IFNULL( expression, replacement )}
Return Type:
The same as the numeric expression.
SQL SYNTAX 2:
IFNULL( expression )
Return Type:
BOOLEAN
SELECT ifnull( name , '')
添加回答
举报