Progress
Open Client
Developer’s Guide


The ActiveX Client Application Using AccountInfo

The code in Example 7–6 demonstrates how to create and use AppObjects and ProcObjects from a Visual Basic client.

ActiveX Client Using AccountInfo
 ’ Create and connect to the AppObject.
 Dim acct As AccountLib.CAccount
 Dim info As AccountLib.CAcctInfo
 
 Set acct = New CAccount
 Call acct.OC_Connect("AppServer://ithaca:3090", "guest", "guest", "")
 
 ’ Creates a Persistent Procedure instance for account 777
 Set info = acct.CreatePO_AcctInfo(777)
 
 ’ Gets information about payments done after a specific date to
 ’ payees who belong to the payeeList set.
 ’ This example does not show the details of what the payeeList is.
 Dim fromDate As Double
 Dim payeeList As VBTT.VBTempTable  ’NOTE: Implementation not shown.
 Dim payees As ProTempTableLib.CProTempTable
 Dim payments As ProTempTableLib.CProTempTable
 Dim paymentsNum As Long
 
 fromDate = #1/10/98#
 Set payeeList = New VBTempTable
 Set payees = New CProTempTable
 payees.DataSource = payeeList
 Set payments = New CProTempTable
 ’ Make the call
 Call info.getPaymentsInfo(fromDate, payees, paymentsNum, payments)
 
 MsgBox ("The number of records is: " + Str(paymentsNum))
 
 ’ Prints all the payment records.
 Dim moreRecords As Boolean
 Dim columnData As Variant
 Dim numCols as Integer
 
 numCols = payments.Fields.Count
 moreRecords = payments.MoveNext
 
 While moreRecords
     ColumnData = payments.GetRow
     For i = 0 To numCols - 1
         MsgBox columnData(i)
     Next i
     moreRecords = payments.MoveNext
 Wend 
 ’ Deletes the persistent procedure.
 info.OC_Release
 
 ’ Release the AppObject.  Since this is the last object to share
 ’ the connection this disconnects from the AppServer.
 acct.OC_Release 

Example 7–6: ActiveX Client Using AppServer Objects

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095