Creating an OLE Script

Hummingbird Neighborhood

Creating an OLE Script

You can code OLE Automation containers to implement all of 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, transferring files from host to host, and so on. You can use any tool that supports OLE Automation control, such as Visual Basic and Visual C++.

To create an OLE Script:

  1. Create the main FTP Engine object. All objects support a dual interface. This lets you fully use the FTP OLE features. For example:

Dim FtpEngine As Object

Set FtpEngine = CreateObject (“HclFtp.Engine”)
  1. Retrieve an FTP Sessions collection. This lets you set such things as local drives, access permissions, and so on. For example:

Dim FtpSessions As Object

Set FtpSessions = FtpEngine.Sessions
  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, user account, and so on. For example:

FtpSession1.ServerName=”ftp.com”
  1. Call session methods such as Connect to Host, User Login, Get, and so on. For example:

FtpSession1.UserLogin