H
HSalim
Hi,
I 'm using the Internet Transfer Library from mvps.org/access.
- well, I actually imported the classes into my XP mdb.
I have not spent the time trying to understand a good portion of the code -
I need to get this done by the end of the day, so hopefully someone will
give me a quick leg up.
I am trying to upload a file and am using the sample code in the read me
file. I have made a few modifications, based on a few guesses.
..DestinationFile - I guessed that it is used to provide a saveAs file name
..AutoCreateRemoteDir - not needed
IF Not .IsConnected - commented not needed for testing atleast
so we chug along nicely till .UploadFileToFTPServer
which is where I get the error. - see error descriotion below.
How can I get past this? I tried calling UploadFileToFTPServer again to no
avail.
HS
ps. I have edited the error description and the code for security, but I
have been careful to not change anything material.
--------------Err.Description -------
220-
220- SomeSite FTP Server
220-
220-Authorized access only. All access is logged. Violators will
220-be prosecuted.
220-
220 Welcome to the SomeSite FTP Server.
331 Password required for HSALIM.
230 User HSALIM logged in.
-----------------------------------
'********** Code Start ****************
Sub TestFTPUpload()
On Error GoTo ErrHandler
Dim objFTP As FTP
Const conTARGET = "ftp://ftp.somesite.com"
Set objFTP = New FTP
With objFTP
.FtpURL = conTARGET
.SourceFile = "C:\TestExport\testfile.txt"
'.DestinationFile = "/2/test.txt"
'.AutoCreateRemoteDir = True
'If Not .IsConnected Then .DialDefaultNumber
.ConnectToFTPHost "HSALIM", "mypassword"
.UploadFileToFTPServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
Exit Sub
ErrHandler:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly,
Err.Source
Resume ExitHere
End Sub
'********** Code End ****************
I 'm using the Internet Transfer Library from mvps.org/access.
- well, I actually imported the classes into my XP mdb.
I have not spent the time trying to understand a good portion of the code -
I need to get this done by the end of the day, so hopefully someone will
give me a quick leg up.
I am trying to upload a file and am using the sample code in the read me
file. I have made a few modifications, based on a few guesses.
..DestinationFile - I guessed that it is used to provide a saveAs file name
..AutoCreateRemoteDir - not needed
IF Not .IsConnected - commented not needed for testing atleast
so we chug along nicely till .UploadFileToFTPServer
which is where I get the error. - see error descriotion below.
How can I get past this? I tried calling UploadFileToFTPServer again to no
avail.
HS
ps. I have edited the error description and the code for security, but I
have been careful to not change anything material.
--------------Err.Description -------
220-
220- SomeSite FTP Server
220-
220-Authorized access only. All access is logged. Violators will
220-be prosecuted.
220-
220 Welcome to the SomeSite FTP Server.
331 Password required for HSALIM.
230 User HSALIM logged in.
-----------------------------------
'********** Code Start ****************
Sub TestFTPUpload()
On Error GoTo ErrHandler
Dim objFTP As FTP
Const conTARGET = "ftp://ftp.somesite.com"
Set objFTP = New FTP
With objFTP
.FtpURL = conTARGET
.SourceFile = "C:\TestExport\testfile.txt"
'.DestinationFile = "/2/test.txt"
'.AutoCreateRemoteDir = True
'If Not .IsConnected Then .DialDefaultNumber
.ConnectToFTPHost "HSALIM", "mypassword"
.UploadFileToFTPServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
Exit Sub
ErrHandler:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly,
Err.Source
Resume ExitHere
End Sub
'********** Code End ****************