
HELP - Newbie needs help on simple problem!
Since no one else has taken a stab at this, I'll try a few suggestions. I
spent a lot of time on FTP but abandoned the method that you are using
because it could not accept a specific request to send ASCII, which I
absolutely had to have. My FTP is between a PC and a UNISYS host, and
without ASCII it just didn't work. However, here are some things that might
help:
Put a STOP statement in just before your Inet1.execute statement. Move the
cursor over each variable (you probably know that this will display the
variable values) to make sure that they contain the values that you think
they should. Did strUr get the IP address OK? Did strSource get the full
path to file name? Did strDest also get a full (and valid) path?
If all else fails, go to Microsoft and get the VBFTPJR project. You can
find it at:
http://www.microsoft.com/gallery/samples/networking/vbftpjr/default.asp It
comes with the source code. It uses API calls to control the FTP process
(and can specify ASCII if needed - YAY!). It is a very complete program as
is and can probably do what you want without ANY modification whatsoever.
You can do as I did and piece together (slowly) how it works and make your
own as desired.
Hope this helps.
Bill Ghen
Quote:
> I just started with Visual Basic (V6.0) and cannot get my beginning
>program to work. I want to download ftp files and store them on my hard
>drive. The example in the book uses the statement:
> Inet1.Execute strUrl, "GET " & strSource & " " & strDest
>where strUrl contains the ftp address, strSource contains the name of the
>file to be retrieved, and strDest is the location and name of the place to
>store the file. This seems to work okay with the defaults provided in the
>program. However, whenever I change the name of the ftp site or file name,
>I get the following output:
> 200 Type set to I.
> 200 PORT command successful
> 550 <file name> no such file or directory
>The file does exist because I download it manually on a daily basis! What
>could be wrong?
>Also, I tried to write my own program using the example code and hardwiring
>in the file and ftp site information since this is an operation I perform
>manually each day. When I run my own program I get
>Runtime error "424":
>Object required
>The offending code is the last line in:
>strURL = "ftp://ftp.fcc.gov"
>strSource = "/pub/Bureaus/Mass_Media/Databases/amdata.dat.gz"
>strDest = "g:\amdata.gz"
>Inet1.Execute strURL, "GET " & strSource & " " & strDest
>The "str" variables are, of course, Dim as strings.
>Please help! I'm sure I'm doing something VERY stupid since I'm a newbie
>but I cannot seem to find any help in my three VB reference books. I can't
>help but think that there must be a library or something that should be
>linked in with my code so VB recognizes the Inet1 command.
>Thanks, in advance, for any help that may be offered.
> Larry Morton
>P.S. My fulltime Internet connection is through a DSL link, which I HIGHLY
>recommend to anyone doing serious Internet access. It's VERY fast! I hope
>it isn't the cause of the problem.