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.
???
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: