Access & FTP

P

PeterM

I have the following code in a form
Call Shell("ftp.exe -s:FTPCommands.txt", vbMinimizedNoFocus)

which doesn't work....but if I open a DOS window, go to the directory where
the FTPCommands.txt file is located and enter

ftp.exe -s:FTPCommands.txt

it works great so I know the commands in the FTPCommands.txt file are
ok....does anyone have any idea what I'm doing wrong?

I would appreciate any help you could offer...thanks!
 
P

PeterM

that's where I originally got the code. I followed the example except I
don't need to qualify the ftp.exe call with the system path... any other
ideas?
 
P

PeterM

OK...so I took the code EXACTLY from the example that you provided

Sub sFTP(stSCRFile As String)

'Private Sub FTP_CDMi()
On Error GoTo FTP_CDMi_error

'Usage Example:
' call sFTP("C:\temp\test.scr")
'Sample SCR File for NT/Win95 FTP
' lcd "c:\temp"
' open ftp.someserver.com
' anonymous
' [email protected]
' cd public
' binary
' get dead.letter dead.letter
' bye

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

and used the following commands in the file containing the directives for
FTP and it doesn't work...a DOS window flashes for an instant and no transfer
begins....

yet when I open a DOS window and execute
ftp.exe -s:ftpcommands.txt

it works fine...I'm desperate....what am I doing wrong?

open cdmprofessionalservices.com
cdmi
cdmpsllc
lcd C:\Documents and Settings\Peter A. Mollica\My Documents\_CDM
Professional Services\_CDMi
cd MDB
binary
get CDMi.mdb
bye
 
Top