?
Solved

Using Internet Transfer Control the GetChunk returns 'junk' data

Posted on 2006-06-05
4
Medium Priority
?
352 Views
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 :)

Cheers,

`Andy
0
Comment
Question by:Andy1
  • 2
4 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 16832942
an example of its use can be found here

http://www.vb-helper.com/howto_inet_getchunk.html

0
 
LVL 65

Expert Comment

by:rockiroads
ID: 16832949
Looks like u should use the StateChanged method

http://www.vbip.com/itc/itc-http-progress-01.asp
0
 
LVL 2

Accepted Solution

by:
xizor earned 2000 total points
ID: 16833004
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.
0
 
LVL 1

Author Comment

by:Andy1
ID: 16833017
Thanks, that was it exactly!!

Cheers!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

807 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