Solved

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

Posted on 2012-04-05
5
232 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
Comment Utility
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
Comment Utility
OK I keep hitting an error on the Open  section that states the wrong file name
0
 

Expert Comment

by:BlueMurder
Comment Utility
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
Comment Utility
If you can post your current code, I will take a look.
0
 

Author Comment

by:LSpiker
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now