Skip to content

How to update listview ONLY when new data is avilable?

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #187939
    autopilot
    Member

    Hope this clears it up… make the code from your post above part of a function or sub called refreshlistview… then in another sub use something like:

    Dim objDocCopy As MSXML2.DOMDocument
    private sub XMLCompair()
    Dim objDoc As MSXML2.DOMDocument

    'load the xml document
    Set objDoc = New MSXML2.DOMDocument
    objDoc.async = False
    objDoc.Load "http://localhost/xmloutput.php"

    'compair files
    if objDoc objDocCopy then
    objDocCopy = objDoc
    refreshlistview()
    end if
    end sub

    you only want to process the xml if it has changed… so you want to load the web page, check if it has changed, and if it has, make a copy of it and then refresh the listview.

    autopilot

    #187938
    method
    Member

    thanks for your reply. Loading what page?

    In Onload event i prepare listview1 and i start the timer and from inside timer i call populatelistview that holds my code. populatelistview reload listview .

    So where should i use your code?what should be inside refreshlistview() ?

    You never mentioned timer? how then i do the check regulerly?

    #187937
    autopilot
    Member

    @method wrote:

    thanks for your reply. Loading what page?

    http://localhost/xmloutput.php”

    @method wrote:

    In Onload event i prepare listview1 and i start the timer and from inside timer i call populatelistview that holds my code. populatelistview reload listview .

    Instead of calling populatelistview from your timer, call XMLCompair from my previous post and from XMLCompair call populatelistview (instead of refreshlistview) if the 2 xml files are different.
    @method wrote:

    So where should i use your code?what should be inside refreshlistview() ?

    You never mentioned timer? how then i do the check regulerly?

    i never mentioned how to use the timer because i thought you would be able to figure out how to put it together on your own.

    autopilot

    #187936
    method
    Member

    I already tried what you have suggested before your post but i keep getting this error:

    Run-time error 453

    object doesn’t support this property or method

    pointing at

    ‘compair files
    If objDoc objDocCopy Then

    furthermore,shouldn’t this line:
    Dim objDocCopy As MSXML2.DOMDocument

    be outside compair function?

    #187935
    autopilot
    Member

    @method wrote:

    furthermore,shouldn’t this line:
    Dim objDocCopy As MSXML2.DOMDocument be outside compair function?

    if you look back up at my post, it is outside the sub @autopilot wrote:

    Dim objDocCopy As MSXML2.DOMDocument
    private sub XMLCompair()

    just a note… you may need to dim as new

    Dim objDocCopy As New MSXML2.DOMDocument

    as far as you getting an error, i am not sure what to tell you… i have never used vb6… i did basic programming a long time ago (15 yrs or more) and just in the last 2 yrs i have started programming with vb 2005… so i dont know what else to tell you…

    but i will look at compairing xml files with vb 2005 and see what i can come up with… but the should work (i never tested it though)

    autopilot

    #187934
    autopilot
    Member

    You may have to use the .innertext to make the compair… try the following:

      'compair files
    If objDoc.InnerText objDocCopy.InnerText Then
    objDocCopy = objDoc
    populatelistview()
    end if

    autopilot

    #187933
    method
    Member

    I get this error now:

    Compile error:

    Method or data member not found

    pointing at:

    .

    InnerText

Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.