Solved

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

Posted on 2004-08-31
8
382 Views
Last Modified: 2006-11-17

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
0
Comment
Question by:Sam Cohen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 100 total points
ID: 11948766
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
 
LVL 8

Author Comment

by:Sam Cohen
ID: 11949149
how do i do that??
0
 
LVL 8

Author Comment

by:Sam Cohen
ID: 11949625
Quick question , does this code transfer jpgs ? gifS?
 
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11951345
It should transfer anything.
0
 
LVL 8

Author Comment

by:Sam Cohen
ID: 11961840
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
 
LVL 8

Author Comment

by:Sam Cohen
ID: 11965807
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question