Quick and dirty...
I had a similar problem, and not being that familiar with Access I decided to build an ftp batch file on the fly, call the Windows command prompt with the batch file, and wait for the command prompt to finish. It works, but it might not be pretty...
Example:
Public Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
...
Private Declare Function WaitForSingleObject Lib _
"kernel32" (ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) As Long
...
Private Function ShellProgramAndWait(ProgramName As String, Prompt As String, Windowstyle As Integer) As Boolean
Dim hHandle As Long, pid As Long
pid = Shell(ProgramName, Windowstyle)
If pid <> 0 Then
hHandle = OpenProcess(SYNCHRONIZE, 0&, pid)
WaitForSingleObject hHandle, INFINITE
ShellProgramAndWait = True
Else
ShellProgramAndWait = False
End If
End Function
...
I copied the code above from someone else...
...
Public Function ListFTPContents(IPAddress As String, username As String, password As String, remotedir As String, batchfile As String, resultsfile As String, strTable As String) As Integer
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(batchfile, True)
a.WriteLine ("open " & IPAddress)
a.WriteLine (username)
a.WriteLine (password)
a.WriteLine ("cd " & Chr(34) & remotedir & Chr(34)) ' or any other valid ftp command
a.WriteLine ("Dir")
a.WriteLine ("Quit")
a.Close
commandline = "cmd /U /C " & Chr(34) & "ftp -s:" & Chr(34) & batchfile_
& Chr(34) & " >" & Chr(34) & resultsfile & Chr(34) & Chr(34)
shellresult = ShellProgramAndWait(commandline, "FTP", vbHide)
If shellresult = False Then GoTo PROC_EXIT
...
You can then parse the resultsfile for the results of the operations.
Regards,
swedela