Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2004, 08:35 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default FTP within VBA

I am trying to run a shell routine within Access VBA, to FTP download a file.
However the code that follows the shell command tries to read this new file but the download hasn't been completed.

Desirably, I would like to create a wait event until the shell is closed,
or failing this just create a delay of a fixed amount of secs.

the code is:

RetValue = Shell("c:\Program Files\WS_FTP Pro\ftpscrpt.exe -f c:\Data\script1.scp")


Thanks in advance Ray
__________________
Cheers Ray
 
Old May 19th, 2004, 09:02 PM
Authorized User
 
Join Date: Feb 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.mvps.org/access/api/api0004.htm

Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]
 
Old May 20th, 2004, 02:49 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Jurgen - Great. Didn't realise it was so involved.

Cheers Ray
 
Old May 20th, 2004, 07:54 PM
Authorized User
 
Join Date: May 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How about capturing the file size of file to be downloaded before downloading?

After the FTP download command, create a Wait Loop that just loops checking filesize until it equals the initial value captured. When the downloaded file size matches, then you continue with the rest of the code.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
VBA FTP k_kosaraju Access VBA 0 January 25th, 2006 11:58 AM
FTP Upload from Excel 2003 VBA Jersey Eric Excel VBA 3 January 5th, 2006 09:29 AM
FTP pakman BOOK: Excel 2003 VBA Programmer's Reference 0 June 27th, 2005 04:24 AM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.