Access collective,
I am running WinNT4.0, Acc2000 SR1 and IE 6.0.
I converted (from Acc97) and imported Dev Ashish's InetTransferLib add-in
modules into my Acc2000 database. Using the sample FTP upload code provided
by Dev, I can connect to my FTP server but it will not upload the specified
file. However, it can create a non-existent directory if I set
..AutoCreateRem oteDir = True.
Dev's sample code with my modifications:
*************** *************** **********
Sub TestFTPUpload()
On Error GoTo ErrHandler
Dim objFTP As FTP
Const conTARGET = "ftp://***.***.***.*** "
Set objFTP = New FTP
With objFTP
.FtpURL = conTARGET
.SourceFile = "C:\TEMP\File_N ame.txt"
.DestinationFil e = "/Parent_Dir/Sub_Dir/File_Name.txt"
.AutoCreateRemo teDir = True
If Not .IsConnected Then .DialDefaultNum ber
.ConnectToFTPHo st "UserName", "PassWord"
.UploadFileToFT PServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmd RemoveMeter)
Exit Sub
ErrHandler:
MsgBox Err.Number & vbCrLf & Err.Description , vbCritical + vbOKOnly, Err.Source
Resume ExitHere
End Sub
*************** *************** **********
The error I am getting is:
-2147219289
200 Type Set to I
Using my local FTP client from the DOS command line, I can connect,
cd to the desired directory, change type to binary and upload the
file all without error. Also, the FTP server puts me in the root
"/" directory, not a /home/user directory somewhere off root.
In a previous posting concerning this error, I noticed the next
command after "200 Type Set to I" was to set the PASSIVE MODE. I
don't think my FTP server supports passive transfers as some
accompanying documentation says to disable this setting. How and
where can this setting be manipulated?
Also, how can I view what is sent to and passed from the FTP client?
While I have stepped through Dev's code, I can't say I completely
understand all of it. I do see where apiInetGetLastR esponse captures
what is presumably the last response from the FTP server when a
command from the FTP object is rejected. How can I see what commands
the FTP object is sending that may be causing the error?
Thanks for any and all help,
Tony
I am running WinNT4.0, Acc2000 SR1 and IE 6.0.
I converted (from Acc97) and imported Dev Ashish's InetTransferLib add-in
modules into my Acc2000 database. Using the sample FTP upload code provided
by Dev, I can connect to my FTP server but it will not upload the specified
file. However, it can create a non-existent directory if I set
..AutoCreateRem oteDir = True.
Dev's sample code with my modifications:
*************** *************** **********
Sub TestFTPUpload()
On Error GoTo ErrHandler
Dim objFTP As FTP
Const conTARGET = "ftp://***.***.***.*** "
Set objFTP = New FTP
With objFTP
.FtpURL = conTARGET
.SourceFile = "C:\TEMP\File_N ame.txt"
.DestinationFil e = "/Parent_Dir/Sub_Dir/File_Name.txt"
.AutoCreateRemo teDir = True
If Not .IsConnected Then .DialDefaultNum ber
.ConnectToFTPHo st "UserName", "PassWord"
.UploadFileToFT PServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmd RemoveMeter)
Exit Sub
ErrHandler:
MsgBox Err.Number & vbCrLf & Err.Description , vbCritical + vbOKOnly, Err.Source
Resume ExitHere
End Sub
*************** *************** **********
The error I am getting is:
-2147219289
200 Type Set to I
Using my local FTP client from the DOS command line, I can connect,
cd to the desired directory, change type to binary and upload the
file all without error. Also, the FTP server puts me in the root
"/" directory, not a /home/user directory somewhere off root.
In a previous posting concerning this error, I noticed the next
command after "200 Type Set to I" was to set the PASSIVE MODE. I
don't think my FTP server supports passive transfers as some
accompanying documentation says to disable this setting. How and
where can this setting be manipulated?
Also, how can I view what is sent to and passed from the FTP client?
While I have stepped through Dev's code, I can't say I completely
understand all of it. I do see where apiInetGetLastR esponse captures
what is presumably the last response from the FTP server when a
command from the FTP object is rejected. How can I see what commands
the FTP object is sending that may be causing the error?
Thanks for any and all help,
Tony
Comment