Using Internet Transfer Control the GetChunk returns 'junk' data

Posted on 2006-06-05
Last Modified: 2008-02-01
I'm working in access 2003 using the Microsoft Internet Transfer Control ActiveX control and I've run the

Execute.DIR myfile

to see if a file exists on the site...

using the GetChunk to get the returned data I am getting the file name of the file (when it exists) followed by four squares (unknown symbols?) of junk data.

if display the results in a msgbox the junk characters dont print, but how do I remove them so i can evaluate the data in code?

I dont want to just remove the last 4 characters, cause i dont know what they are or if there will always be just 4 junk characters?

In VB I would use something like:

RetreivedData = Left$(RetreivedData , InStr(1, RetreivedData , Chr$(0)) - 1)

But that doesn't seem to want to work for me...

Any help greatly appreciated :)


Question by:Andy1
    LVL 65

    Expert Comment

    an example of its use can be found here

    LVL 65

    Expert Comment

    Looks like u should use the StateChanged method
    LVL 2

    Accepted Solution

    The 'junk' characters you are getting will be non-printing characters.

    Your code:
        RetreivedData = Left$(RetreivedData , InStr(1, RetreivedData , Chr$(0)) - 1)
    is looking for character 0

    Change it to look for character 13 (a carriage return)
        RetreivedData = Left$(RetreivedData , InStr(1, RetreivedData , Chr$(13)) - 1)

    I think you'll find this is all you need to do.
    LVL 1

    Author Comment

    Thanks, that was it exactly!!


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now