Visualizzazione dei risultati da 1 a 6 su 6

Discussione: xml & db Access 2000

  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786

    xml & db Access 2000

    Salve Amici,

    vorrei scorrere questo file xml:

    http://www.html.it/rss/webnews_focus.xml

    è salvarmi in un db Access 2000 i seguenti punti:

    title

    link

    description

    author

    si puo' fare ?

    mi postate un codice Asp di Esempio che in caso modifico io ?

    Grazie !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  2. #2
    Sai leggere un feed Rss?

    Salva in N variabili i vari item del file; conta il nulero di record del file XML oppure impostalo staticamente (es. 10); fai un ciclo For da 0 al numero di record - 1 in modo che ripeti N volte una insert del tipo

    For i = 0 To 9
    INSERT INTO teballa (titolo, link, ecc) VALUES ('" & titolo(i) & "', '" & link(i) & "', '" & ecc(i) & "')
    Next

    Ciao

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    Originariamente inviato da lukeonweb
    Sai leggere un feed Rss?

    Salva in N variabili i vari item del file; conta il nulero di record del file XML oppure impostalo staticamente (es. 10); fai un ciclo For da 0 al numero di record - 1 in modo che ripeti N volte una insert del tipo

    For i = 0 To 9
    INSERT INTO teballa (titolo, link, ecc) VALUES ('" & titolo(i) & "', '" & link(i) & "', '" & ecc(i) & "')
    Next

    Ciao
    non so leggere un feed Rss

    mi puoi postare un esempio tu per favore ?

    Grazie !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  4. #4

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    ho provato a sistemarlo:

    codice:
    <%
       ' Creo oggetto DOM XML 
       Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0") 
       objXML.async = false 
       objXML.setProperty "ServerHTTPRequest", True 
    
       ' validazione del documento XML
       objXML.validateOnParse =false' true 
    
       ' non conservare spazi 
       objXML.preserveWhiteSpace = false 
    
       blnLoaded = objXML.Load(url) 
       
       If Not blnLoaded Then 
          Response.write "Nessuna news da visualizzare" 
       Else
       
    	  set objNodeList = objXML.getElementsByTagName("channel") 
    
          For Each objNode In objNodeList 
          For Each objNode2 In objNode.childNodes 
    
    Select Case objNode2.nodeName 
    Case "title" 
    html = html + "<tr><td>"
    html = html + objNode2.firstChild.nodevalue 
    html = html + "</td></tr>"
    Case "link" 
    html = html + "<tr><td><a target=_blank href=" + objNode2.firstChild.nodevalue + ">"
    html = html + objNode2.firstChild.nodevalue 
    html = html + "</a></td></tr>"
    Case "description" 
    html = html + "<tr><td>"
    html = html + objNode2.firstChild.nodevalue 
    html = html + "</td></tr>"
    End Select 
    Next 
    Next 
    
    html = html + "<tr><td><hr></td></tr>"
    
    Set objNodeList = objXML.getElementsByTagName("item") 
    For Each objNode In objNodeList 
    For Each objNode2 In objNode.childNodes 
    Select Case objNode2.nodeName 
    Case "title" 
    strTitle = objNode2.firstChild.nodevalue 
    Case "link" 
    strURL = objNode2.firstChild.nodevalue 
    Case "description" 
    strDescription = objNode2.firstChild.nodevalue 
    End Select 
    Next 
    
    html = html + "<tr><td><li/>" + strTitle + "
    " + strDescription 
    +"</td></tr>"
    strTitle = "" 
    strURL = "" 
    strDescription = "" 
    Next 
     
          set objNodeList = Nothing 
       End if 
    %>
    la parte in rosso è quella che non ho capito, cioè come si recuperano title, link e description ,

    cioè non dovrebbe essere una cosa così:
    title = objNode2.title.nodevalue

    fatta in loop ?

    Grazie !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  6. #6
    è quasi tutto in rosso

    dunque... non l'ho mai letto questo articolo, anche perchè io uso JScript, non vb

    prova a tradurre questo in vb, è molto più snello e lineare

    http://www.lukeonweb.net/leggi.asp?id=275

    una volta fatto questo, applica quello che ti ho detto nella mia prima risposta

    sto andando a casa, se non ti rispondo per un po non me ne volere ;-)

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 © 2025 vBulletin Solutions, Inc. All rights reserved.