---
title: "skapa en RSS-fil"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/165553-skapa-en-rss-fil"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Vinnaren"
published: "2007-10-16T19:50:07.000Z"
updated: "2007-10-18T11:05:09.000Z"
replies: 3
views: 416
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/165553-skapa-en-rss-fil"
---

# skapa en RSS-fil

## #1 — Vinnaren, 2007-10-16T19:50Z

Hej

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

Permalänk: https://www.webforum.nu/p/165553

## #2 — Fredde Mannen, 2007-10-16T19:54Z

> **Vinnaren skrev:**
>
> Hej
> 
> 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... 

bara fundering.. :)

Permalänk: https://www.webforum.nu/p/2042259

## #3 — Vinnaren, 2007-10-16T20:04Z

hjälpte tyvärr inte att höja server.scripttimeout. Jag vill undvika att anropa databasen onödigt mycket, därför vill jag ha det i en rss fil.

Permalänk: https://www.webforum.nu/p/2042270

## #4 — Vinnaren, 2007-10-18T11:05Z

ingen som vet hur jag kan få ut en fil   :q

Permalänk: https://www.webforum.nu/p/2042655

---

Tråden på webben: https://www.webforum.nu/amne/asp/165553-skapa-en-rss-fil
