Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help with FTP command within Access 2000 VBA 2

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
MX
Can anyone see anything wrong with this syntax:

Shell ("C:\WINNT\SYSTEM32\FTP.EXE -V -N -S: PUT C:\LABELS\115M34.TXT 172.16.7.10")

I am trying to send the file C:\LABELS\115M34.TXT to the device with a TCP/IP address of 172.16.7.10 and it just does not work. No error messages are being produced, it just does not work. I am using Windows 2000 SP4 and Access 2000 VBA. Thanks so very much for any suggestions.
 
The full code I am trying to use goes like this:

Function Printer()
Open "c:\winnt\system32\10.txt" For Output As #1
Print #1, "Put c:\Labels\160M33.txt"
Print #1, "quit"
Close #1
Shell ("c:\winnt\system32\ftp -v -n -s: 10.txt 172.16.7.10")
End Function

The actual text file I want to use is c:\Labels\160M33.txt. The black FTP DOS CMD window just flashes on the screen and I cannot see what if any errors are being produced. Is there a way to set this window to stay open so I can tell what is going on ? I can manually start the CMD window, Start FTP and Open 172.16.7.10 and then Put c:\Labels\160M33.txt which then works as it should, but from VBA this is just not working for some reason, please help if you can. Thanks very much, Vamoose.
 
by the end try using

pause
then the window will stay open untill you press a key
 
You may try something like this:
CreateObject("WScript.Shell").Run "%COMSPEC% /K ftp -v -n -s:\winnt\system32\10.txt 172.16.7.10", , True


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top