Solved

How do I programmatically copy a text file from ftp/  to  a local folder using MSAccess2007?

Posted on 2012-04-05
5
243 Views
Last Modified: 2012-11-13
I see very little info on this subject and when I do see something it doesn't apply.  Please help.

Currently I am physically going to Internet explorer, putting in an ftp address with passwords included.  Then I click on view and click "Open FTP site in Windows Explorer".  From there I copy a file to a local file folder.

How do I do all of that programmatically in Access using VBA?

Thanks
0
Comment
Question by:LSpiker
  • 3
  • 2
5 Comments
 

Expert Comment

by:BlueMurder
ID: 37812163
Check this out...

Sub ftp_snb
  ChDir "E:\map"                                         '  see 1
  Open "E:\script.ftp" For Output As #1          '  see 2
    Print #1, Replace("username|password|binary|** /httpdocs/...|mget *.xls|quit", "|", vbCrLf)
  Close #1
  Shell "ftp -v -i -s:E:\script.ftp website.com"
End Sub

Open in new window


1. change the directory in which you want the downloaded files to be stored.
2. adapt the path where you want to store the ftp file
3. replace 'username' by your username for this ftp-server
replace 'password' by your password for this ftp-server
change '/httpdosc/...' in the directory where the to be downloaded files reside.
change '*xls' by the extension of the files you want to download.
4. adapt the ftp-files path according to step 2
5. replace 'website.com' by the name of the ftp-server

Check here...
0
 

Author Comment

by:LSpiker
ID: 37812370
OK I keep hitting an error on the Open  section that states the wrong file name
0
 

Expert Comment

by:BlueMurder
ID: 37812664
The implication there is that either the file name is incorrect or that the pathing is incorrect.  Can you validate that both are good?  You may be looking in the wrong place for the file or may be missing a "/" or something.
0
 

Accepted Solution

by:
BlueMurder earned 500 total points
ID: 37812674
If you can post your current code, I will take a look.
0
 

Author Comment

by:LSpiker
ID: 37812695
Well I got the connection working but it still didn't download the files.  

I noticed that the link you posted also showed that the page you were referring to also didn't work once the connection was made.

Any other ideas?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…

756 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