Question FTP communication

SSharp

New member
Local time
Today, 11:39
Joined
Aug 4, 2008
Messages
2
I am trying to post a .dat file to an FTP site using an Access form.
I can make this work if i run the steps manually, but need it to work in a .bat file so it is easy for the user.

Here is what I have so far:

1. In my Access form -
Call sFTP("Z:\ACImports\BatFiles\FTPCmd3.bat")

2. In the module code for sFTP -
Sub sFTP(stSCRFile As String)
Dim stSysDir As String
stSysDir = Environ$("COMSPEC")
stSysDir = Left$(stSysDir, Len(stSysDir) - Len(Dir(stSysDir)))
Call Shell(stSysDir & "ftp.exe -s:" & stSCRFile, vbNormalFocus)
End Sub

3. In the .bat file FTPCmd3.bat –
OPEN ftp.ftpserv.company.com
ssahs
ssahs2ftp$
lcd Z:\acimports\impfiles
cd C:\ftp\ahs\tosl
ascii
prompt
mput I*.*
Quit

Again, this works if I manually run the commands in a dos window, but will not work in Access.

???
 
Last edited:
Don't know anything about batch files, but just so you know, you could just use a library to automate the FTP tasks... This would be more robust (and hopefully easier, if the library is well-documented) than using a batch file, I'd think...
 
I chose the batch file route because that is what I found while searching on ways to do this. Here is the link where i found this code: http://www.mvps.org/access/modules/mdl0015.htm

I don't know what you mean by "use a library to automate the FTP tasks" - if you have an example that would be great....
 

Users who are viewing this thread

Back
Top Bottom