Solved

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

Posted on 2004-08-31
8
381 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
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

860 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