Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Feed RSS - Da Access a XML

    Salve,
    ho trovato in giro uno script che dovrebbe permettere di generare un FEED RSS tipo quello usato anche da Html.it ( http://www.html.it/rss/webnews_news.xml ).

    Il Codice è il seguente
    <%LANGUAGE="VBScript"%>
    <% ' Set Timeout for large databases and / or slow Servers, default = 90 (seconds) %>
    <% Server.ScriptTimeout = 3600 %>
    <%
    ' ###################################
    ' # Author : Tranzity #
    ' # Email : tranzity@forze.nl #
    ' # Date : 03-04-2002 #
    ' # Language: ASP/VBScript #
    ' # Function: DB to XML #
    ' ###################################

    ' Define variables
    dim wsh, rs

    ' DB connection
    dim Conn
    Set Conn = Server.CreateObject("ADODB.Connection")
    sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & Server.MapPath("/mdb-database/database.mdb") & ";" & _
    "Persist Security Info=True"
    Conn.Open(sConnection)

    ' Loads the recordset
    set rs = conn.Execute("SELECT * FROM esempio ORDER BY ID DESC")

    ' Open Windows Scripting Shell
    set wsh = createobject("WScript.Shell")

    ' Puts the first XML Lines in the document
    wsh.run("cmd /c echo ^<?xml version=""1.0"" encoding=""ISO-8859-1"" ?^> > " & server.mappath("cddatabase.xml"))
    wsh.run("cmd /c echo ^<cddatabase^> >> " & server.mappath("cddatabase.xml"))
    set wsh = nothing

    ' Loads the complete database into the XML document (This may take a while)
    do until rs.EOF

    set wsh = createobject("WScript.Shell")

    wsh.run("cmd /c echo ^<item^> >> " & server.mappath("cddatabase.xml"))
    wsh.run("cmd /c echo ^<cdid^>" & rs("cdid") & "^</cdid^> >> " & server.mappath("cddatabase.xml"))
    wsh.run("cmd /c echo ^<title^>" & rs("title") & "^</title^> >> " & server.mappath("cddatabase.xml"))
    wsh.run("cmd /c echo ^</item^> >> " & server.mappath("cddatabase.xml"))
    set wsh = nothing

    rs.movenext

    loop

    ' Closes the XML Tags
    set wsh = createobject("WScript.Shell")
    wsh.run("cmd /c echo ^</cddatabase^> >> " & server.mappath("cddatabase.xml"))
    set wsh = nothing

    ' Closes connection
    rs.close
    Conn.close

    %>
    Ora... dato che non ho mai usato XML, ma mi piacerebbe tantissimo generare un feed da un database access... come devo settare il seguente script?

    Help!

  2. #2
    nessuno che sa aiutarmi???

    o mi può consigliare qualche alternativa?

  3. #3
    Quale linguaggio lato server supporta il tuo sito?

    Sto sviluppando una classe ASP per generare RSS che sarà disponibile a giorni, in alternativa in base al linguaggio posso consigliarti già qualche prodotto online.

  4. #4
    il mio sito è in ASP...

    cmq.. ovviamente a me interessa che legga, le news che inserisco, dal database...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.