Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Aap and XML error

  • 02-12-2005 12:27pm
    #1
    Registered Users, Registered Users 2 Posts: 597 ✭✭✭


    Hello all,

    Thats meant to say ASP and XML error!

    I have an asp script (which is contained in a .vbs file) that takes info from an XML page and inserts it into a database. I was trying to get the the script to preform a test to see if the xml script contains a certain element - if it does, then enter it into a database.

    Here is the code :
    Dim XMLDom
    Dim ItemID
    Dim DbConn
    Dim SQLString
    Dim ANArticleNode
    Dim ANArticleNode2
    Dim CollectionOfArticleNodes
    Dim CollectionOfArticleNodes2
    Dim cst
    
    Set XMLDom = CreateObject("MSXML2.DomDocument.4.0")
    XMLDom.async = False
    XMLDom.setProperty "ServerHTTPRequest", True
    
    Set DbConn = Createobject("adodb.connection")
    DbConn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=test1.mdb"
    
    '-- Load the XML data from your live URL
    XMLDom.Load("http://feeds.directnews.org.uk/?ad96035d-f9fe-4a3f-a5b2-ad546b2ed850") 
    
    '-- Create a reference to a collection of all Article Tags within the downloaded XML Document
    Set CollectionOfArticleNodes = XMLDom.SelectNodes("InfoStreamResults/Article/Categories/Category")
    
    '-- Iterate the collection of Article Tags 
    For Each ANArticleNode in CollectionOfArticleNodes 
    	ItemID = ANArticleNode.SelectSingleNode("@ID").text
    	
    	
    if ItemID = "430009735" then
    
    set CollectionOfArticleNodes2 = XMLDom.SelectNodes("InfoStreamResults/Article")
    
        
    Heading = ANArticleNode2.SelectSingleNode("Heading").text	
    	
    
    '-- Insert the item into the local database
    SQLString = "INSERT INTO test (Heading) " _
    		  & "VALUES('" & EncodeIt(Heading) & "');" 
    	DbConn.Execute(SQLString)	
    	
    End If 
    	
    Next
    
    '-- Handles quotations in text
    Function EncodeIt(TextString)
    	TextString = Replace(CStr(TextString), "''", "'")
    	TextString = Replace(TextString, "'", "''")
    	EncodeIt = TextString
    End Function
    


    And here is the error message I am getting :
    Object required: "
    

    any ideas as to what might be the problem here? I really appreciate any input

    Thanks folks


Advertisement