Uploading Files on computer to FTP server-- simple error i think,please help


I have this code below on On_click button on form and i keep getting a User-defined type not define error:

Private Sub Command61_Click()

On Error GoTo ErrHandler
Dim objFTP As InetTransferLib.FTP
Const conTARGET = "ftp://myserver.com"  '<----------------------------your server to upload to

  Set objFTP = New InetTransferLib.FTP
  With objFTP
    .FtpURL = conTARGET
    .SourceFile = vbNullString               '<---------------------------where you get your file
    .DestinationFile = "/etc/""Me.Pic2"""  '<----------------------------where you want your file to be place at
    .AutoCreateRemoteDir = True
    If Not .IsConnected Then .DialDefaultNumber
    .ConnectToFTPHost "username", "password"  '<-------------------------enter username and 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
LVL 8
Sam CohenConsultant to Digital/DeveloperAsked:
Who is Participating?
 
shanesuebsahakarnConnect With a Mentor Commented:
You haven't imported the InetTransferLib objects into your database.

See here:
http://www.mvps.org/access/modules/mdl0037.htm

Read the top part (the underlined text).
0
 
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
how do i do that??
0
 
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
Quick question , does this code transfer jpgs ? gifS?
 
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
shanesuebsahakarnCommented:
It should transfer anything.
0
 
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
i have access 2002
why cant i get that inetlib****
to add-in

I cant seem to get it in my refs
Any thoughts??
0
 
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
I got  it !!
But im get an error "access denied"
it gets as far as creating a folder on server
is something in the code set wrong\

----i have increase the points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.