FTP using Stuart McCall's example

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

Guest

Hello,
I downloaded the db from http://website.lineone.net/~smsburnley/ ; and I am
getting the
following error:

->MsgBox Err.Description, vbCritical <-error occurs here>
"Call to FtpSetCurrentDirectory failed.. (OS error code =0)
Internet Response:"

I have step through the code and did not get any other errors.

Sub TestFTP1()

On Error GoTo TestFTP1_Err

DoCmd.Hourglass True
With New FTPClient
.ServerName = "ftp.sitename.org"
.UserName = "username"
.Password = "password"
.LocalFile = "c:\temp\"
.RemoteDir = "/Db_Backend"
.RemoteFile = "Utility-Cuts_be.mdb"
.TransferType = "BIN"
.OpenFTP
.OpenServer
.GetFile
.CloseServer
.CloseFTP
End With
DoCmd.Hourglass False

TestFTP1_Exit:
Exit Sub

TestFTP1_Err:
MsgBox Err.Description, vbCritical
Resume TestFTP1_Exit

End Sub

Thanks,
NickX
 
Actually I have commented out " .RemoteFile = "Utility-Cuts_be.mdb"" and I
have put message boxes between each line. The OpenFTP works, OpenServer
works and then it hangs up on the GetFile. This is where my error is
generated:

If FtpGetFile(m_hCon, m_RemoteFile, m_LocalFile, False,
INTERNET_FLAG_RELOAD, m_TransferType, 0) = False Then
RaiseError errGetFile
End If

See code below:
 
Back
Top