Solved

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

Posted on 2004-08-31
8
378 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
Comment Utility
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
Comment Utility
how do i do that??
0
 
LVL 8

Author Comment

by:Sam Cohen
Comment Utility
Quick question , does this code transfer jpgs ? gifS?
 
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 41

Expert Comment

by:shanesuebsahakarn
Comment Utility
It should transfer anything.
0
 
LVL 8

Author Comment

by:Sam Cohen
Comment Utility
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
Comment Utility
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

Backup Your Microsoft Windows Server®

Backup 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.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now