|
Question : using InetTransferLib with Access2000
|
|
I am trying to implement this solution
http://www.mvps.org/access/modules/mdl0037.htm
'********** Code Start **************** 'This code was originally written by Dev Ashish 'It is not to be altered or distributed, 'except as part of an application. 'You are free to use it in any application, 'provided the copyright notice is left unchanged. ' 'Code Courtesy of 'Dev Ashish ' Sub TestFTPUpload() On Error GoTo ErrHandler Dim objFTP As InetTransferLib.FTP Const conTARGET = "ftp://ftp.someserver.com"
Set objFTP = New InetTransferLib.FTP With objFTP .FtpURL = conTARGET .SourceFile = vbNullString .DestinationFile = "/2/test.txt" .AutoCreateRemoteDir = True If Not .IsConnected Then .DialDefaultNumber .ConnectToFTPHost "username", "password" .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've imported the class modules into my database. When I debug, It isn't recognizing the InetTransferLib.FTP. It says User defined type not defined. I think I'm missing a reference, but which one? Any help would really be appreciated.
|
|
Answer : using InetTransferLib with Access2000
|
|
While not using it in Addin mode - you need to refer to the class objects themselves. i.e. there is no qualifier. (I think that must be a typo in the Access web saying that you should - it makes no sense to).
i.e. Dim objFTP As FTP
Where you've got the class module FTP.
|
|
|
|