
March 20th, 2008, 01:40 PM
|
|
Contributing User
|
|
Join Date: Jul 2007
Posts: 53
Time spent in forums: 13 h 29 m 25 sec
Reputation Power: 1
|
|
|
Darn "string literal was expected" error
Okay so I'm working on an RSS feed.
And I keep getting the error:
A string literal was expected, but no opening quote character was found. Error processing resource 'http://netstat.co...
<font face="Arial" size=2>
-------------------------^
I have a feeling it has something to do with my complex query. Because if I use a very simple query it works fine...but when I use the query I need it doesn't. Any help would be great!
Code:
<?xml version="1.0" encoding="ISO-8859-1"?><!--#include virtual="Connections/Net.asp" --><% Response.Buffer = true
Response.ContentType = "text/xml"
Function ApplyXMLFormatting(strInput)
strInput = Replace(strInput,"&", "&")
strInput = Replace(strInput,"'", "'")
strInput = Replace(strInput, ">", ">")
strInput = Replace(strInput,"<","<")
ApplyXMLFormatting = strInput
End Function
%>
<rss version="2.0">
<channel>
<title>Current Alarm State</title>
<link>http://netstattest.com</link>
<description>The current alarm state</description>
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = strConn
objConn.Open
Dim objRS, strSQL, strDesc
strSQL = "SELECT p1.source, p1.message, DATE_ADD(p1.cdate, INTERVAL p1.ctime HOUR_SECOND) as cdatetime FROM ala as p1 WHERE p1.ctime = (SELECT max(ctime) FROM ala WHERE source=p1.source AND cdate=p1.cdate) AND ( message LIKE '%Node Down%' OR message LIKE '%If Down%' OR message LIKE '%Address Down%' OR message LIKE '%Connection Down%' ) ORDER BY cdate DESC, ctime DESC LIMIT 2"
Set objRS = objConn.Execute(strSQL)
Do While Not objRS.EOF
strDesc = "<b>Alarm for " & objRS("source") & " on " & _
objRS("cdate") & " EST</b><br>" & _
objRS("message").Value %>
<item>
<title><![CDATA[<%=ApplyXMLFormatting(objRS("message").Value)%>
(<%=ApplyXMLFormatting(objRS("source").Value)%>)]]>
</title>
<description><![CDATA[<%=ApplyXMLFormatting(strDesc)%>]]></description>
<datePosted><![CDATA[<%=ApplyXMLFormatting(objRS("CDATE"))%>]]></datePosted>
</item>
<%
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</channel>
</rss>
|