Creating an OLE Script

FTP

Creating an OLE Script

You can code OLE automation containers to implement all the features and functions of FTP in another application that uses OLE features, such as Hummingbird Basic. You can work with FTP session objects to call functions such as connecting to a host and transferring files from host to host. You can use any tool that supports OLE automation control, such as Visual C++ and Visual Basic.

To access the scripting tool, select Load Hummingbird Basic Script File on the Tools menu.

To create OLE tasks:

  1. Create the main FTP Engine Object. For example:

Dim FtpEngine As Object

Set FtpEngine = CreateObject("HclFtp.Engine")

All objects support a dual interface. This lets you fully use the FTP OLE features.
  1. Retrieve an FTP Sessions collection. For example:

Dim FtpSessions As Object

Set FtpSessions = FtpEngine.Sessions

This lets you set such things as local drives and access permissions.
  1. Create the FTP session object. For example:

Dim FtpSession1 As Object

Set FtpSession1 = FtpSessions.NewSession
  1. Set properties, such as server name, user name, and user account. For example:

FtpSession1.ServerName="ftp.com"
  1. Call the session method, such as Connect to Host, User Log in, and Get. For example:

FtpSession1.UserLogin