Jag ska skapa en rss fil genom att loopa ut alla poster i databasen till den.
har hittills denna kod:
<!--#INCLUDE FILE="../inc/db.asp"-->
<%
Set fso = CreateObject("Scripting.FileSystemObject")
if not fso.FileExists(Server.MapPath("../rss/blogg.rss")) then
Set act = fso.CreateTextFile(Server.MapPath("../rss/blogg.rss"), true)
else
Set act = fso.OpenTextFile(server.mappath("../rss/blogg.rss"))
end if
Set RSS = objConn.Execute("SELECT TOP 10 bID, Rubrik, RSS, Datum, Tid FROM Blogg ORDER BY Datum DESC")
act.WriteLine "<?xml version=""1.0"" encoding=""utf-8"" ?>"
act.WriteLine "<rss version=""2.0"">"
act.WriteLine "<channel>"
act.WriteLine "<title>RSS</title>"
act.WriteLine "<link>http://www.wwwwww.ww</link>"
act.WriteLine "<description>RSS</description>"
DO WHILE NOT RSS.EOF
act.WriteLine "<item>"
act.WriteLine "<title>"&RSS("Rubrik")&"</title>"
act.WriteLine "<link>"&RSS("bID")&"</link>"
act.WriteLine "<description>"&RSS("RSS")&"</description>"
act.WriteLine "<pubDate>"&RSS("Datum")&"</pubDate>"
act.WriteLine "</item>"
RSS.MoveNext
loop
RSS.close
set RSS = Nothing
act.WriteLine "</channel>"
act.WriteLine "</rss>"
act.close
%>
Problemet är att ingen fil skapas, har gett mappen alla rättigheter.
Får felmeddelandet:
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
Jag ska skapa en rss fil genom att loopa ut alla poster i databasen till den.
har hittills denna kod:
<!--#INCLUDE FILE="../inc/db.asp"-->
<%
Set fso = CreateObject("Scripting.FileSystemObject")
if not fso.FileExists(Server.MapPath("../rss/blogg.rss")) then
Set act = fso.CreateTextFile(Server.MapPath("../rss/blogg.rss"), true)
else
Set act = fso.OpenTextFile(server.mappath("../rss/blogg.rss"))
end if
Set RSS = objConn.Execute("SELECT TOP 10 bID, Rubrik, RSS, Datum, Tid FROM Blogg ORDER BY Datum DESC")
act.WriteLine "<?xml version=""1.0"" encoding=""utf-8"" ?>"
act.WriteLine "<rss version=""2.0"">"
act.WriteLine "<channel>"
act.WriteLine "<title>RSS</title>"
act.WriteLine "<link>http://www.wwwwww.ww</link>"
act.WriteLine "<description>RSS</description>"
DO WHILE NOT RSS.EOF
act.WriteLine "<item>"
act.WriteLine "<title>"&RSS("Rubrik")&"</title>"
act.WriteLine "<link>"&RSS("bID")&"</link>"
act.WriteLine "<description>"&RSS("RSS")&"</description>"
act.WriteLine "<pubDate>"&RSS("Datum")&"</pubDate>"
act.WriteLine "</item>"
RSS.MoveNext
loop
RSS.close
set RSS = Nothing
act.WriteLine "</channel>"
act.WriteLine "</rss>"
act.close
%>
Problemet är att ingen fil skapas, har gett mappen alla rättigheter.
Får felmeddelandet:
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
Vad har jag gjort för fel & hur löser jag det??
Tacksam för all hjälp :stud
Det tar väl för lång tid för scriptet att exekvera färdigt.. pröva att sätta server.scripttimeout till något högre..
Varför inte låta en asp-sida verka som rssfeed, på så sätt blir den mer dynamisk och man slipper skapa om filen om om igen för varje nytt inlägg...