Access & FTP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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?
 
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
' (e-mail address removed)
' 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
 
Do Environ$("COMSPEC") returns correct path to cmd or command.com?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top