VBA code to download csv file from FTP site

S

Sabosis

Hello-

Does anyone have simple code to download a csv file from a FTP site? I
have been loking around and can't find a solution that makes sense, or
works correctly. I do have a user ID and password for the FTP site,
and will be downloading the file to my C drive. Any help is GREATLY
appreciated.

Thanks-

Scott
 
S

Stuart McCall

Stuart-

Thanks, but I am totally confused on which of these forms need to be
filled out and how. Is there any documentation for this DB. I keep
getting error messages when I try to do anything.

No documentation but for comments in the code, sorry. Try this to test it
out:

1. Open the form frmFtpExplorer
2. Click the connect button to open MS's server
3. Wait till the button reads 'Disconnect'
4. Double click on BUSSYS in the folder list
5. Double click on UTILITIES in the folder list
6. Note that one of the files is HOTFIXA.EXE
7. Now open frmUpDownTest
8. Set the local file name to:
c:\temp\anything.exe (assuming you have a c:\temp folder)
9. Set the remote folder to:
/bussys/utilities/hotfix
10. Set the remote file name to HOTFIXA.EXE
11. Click on Download

That should download HOTFIXA.EXE to a file in your temp folder called
anything.exe. This can now be deleted (it's no good to you anyway).

Now open frmUpDownTest in design mode and look at the procedure
btnDownload_Click. The line:

..OpenServer "ftp.microsoft.com", "anonymous", "(e-mail address removed)"

needs to be changed to your ftp server name, your login name and your
password.

The way the demo is intended to be used is to import the class module into
your db, then follow the example code behind the forms (also the module
'Test' is useful - no forms required - just alter the hard-coded property
settings and hit F5)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top