Solved

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

Posted on 2004-08-31
8
383 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
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!

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

732 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