Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now