Solved

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

Posted on 2012-04-05
5
239 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

803 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