Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2012-04-05
5
Medium Priority
?
278 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 1500 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

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…
Suggested Courses

876 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