ProductsTechnical SupportDownloadsPurchasingSearch EngineNewsHomeE-mail Us



  • ACE/400 for Visual Studio Key Features
  • DATA Control
  • Remote commands and Retrieve Values
  • AS/400 Program Calls
  • Data Queues
  • RAD



  • ACE/400 for Visual Studio Key Features

     


    DATA Control

    With the Easycom Data Control, you can access any Physical or Logical file on an AS/400 as well as a row set built from a SQL Statement.

    The ‘RecordSource’ property of the Easycom Data Control can contain either an AS/400 database file name, or a ‘SELECT’ statement. The table name can include a library name if the table is not in the user library list, and a member name if needed.

    The methods provided by the Easycom Data Control are compatibles with the original Microsoft DAO control.

    You will write the same statements that you use for a MS Access table.

    Example 1: Retrieve a record key.
    ACE400Data1.Recordset.Seek("=",Key1,Key2)

    Example 2: Get a field value from the record set.
    With ACE400data1.RecordSet
            Text2.Text = .Fields("Cust_ID")

    The Data aware controls from Visual Basic (Grid, Combo boxes, List boxes, Edit boxes, …) will see the Easycom Data Control like a DAO or RDO Data Control.

    The ‘DataSource’ property of the control shows the list of all the data controls, including any DAO control, RDO control and Easycom Data Control.

    The ‘DataField’ property shows the list of the fields from the AS/400 table, if DataSource is connected to an Easycom data Control.

    ACE/400 DATA Control - Screen

    In this example, you can see that the Easycom Data Control is located in the form like the standard DAO control from Visual Basic is.

    In the TextBox properties, the DataSource combo box shows the MS Access DAO as well as the Easycom Data Control. The DataField property combo box will list all the field names from the AS/400 table.


    Remote commands and Retrieve values.

    From your application, you can send a command to your AS/400, and receive values from the command.

    Example 1: Retrieve the user name of the job, and the library list.
    ret = EACVBCommand("RTVJOBA USER(&USR) USRLIBL(&USRL)")
    If ret = EACVBERR_OK Then
        ret = EACVBCommandGetVar("USR", usr)
        ret = EACVBCommandGetVar("USRL", usrl)
    Else
        MsgBox "Failed to execute command"
    End If

    Example 2: Retrieve a Data Area value.
    MyCommand = "DTA=CHAR(200);RTVDTAARA DTAARA(*LDA) RNTVAR(&DTA)")
    ret = EACVBCommand(MyCommand)
    If ret = EACVBERR_OK Then
        ret = EACVBCommandGetVar("RC", rc)
        If rc = "0" Then
            ' Retrieve the data from the variable
            ret = EACVBCommandGetVar("dta", dta)
        Else
            MsgBox ("Error " + rc)
        End If
    End If

    The command string in written in CL, the variables which are due to receive the results are prefixed with the ‘&’ sign, like in CL. The command can contain several variables to retrieve, one can get the value of each one can be get by using the Easycom function ‘EACVBCommandGetVar ‘.


    AS/400 Program calls

    Easycom can call your existing AS/400 programs (RPG, COBOL, CL, C, …), send parameters to them, and receive back the modified parameters.

    You have to describe the calling interface, the data types and size of the parameters, and which parameters are expected by the program, and which are modified.

     AS/400 Programs calls - Screen

    Then, in your application program,you open the procedure like a database file.
        ACE400Data2.DataSource = "*PGM/RPCSAMPLE"

    Issuing a read by key operation (seek) you call the program and retrieve the result.
        With ACE400Data2.recordset
            .Seek("=",20,"My Input String", op2, str2)
            If not .NoMatch
                Text2.Text = .Fields("OP3")



    Data Queues.

    Like the programs structure, the Data Queues structure is described to know what are the data types expected in the message.

    A virtual ‘Time Out’ field is added to the structure, and a virtual ‘KeyField’ also, if the Data Queue is a keyed one.

    Data Queues - Screen

    Then, in your application program, you open the data queue like a database file.
        ACE400Data3.DataSource = "*DTAQ/DTAQ_KEY"

    Issuing a read by key operation (seek) you read from the Data Queue and receive the message. With ACE400Data3.Recordset
        .Seek("=",10, " ", "EQ", TheKeyValue)
        if not .NoMatch
            Text2.Text = .Fields("DATA")

    In this example, we read from a keyed Data Queue, we waited 10 seconds before exiting with ‘NoMatch’ status, in the case of an empty Data Queue.


    RAD

    To make building Client/Server applications easier for Visual Basic 4 and/or 5 developers, EASYCOM For VB provides a wizards to automatically generate VB code and forms to access to the AS/400 resources.

    The access is carried out in native mode. And for better performance, Easycom uses pre-existing access paths and reads only the AS/400 data fields that are needed by the application.

    Visual Basic developers create rapidly AS/400 Client/Server applications.

    The wizard does not generate any code in the modules. Hence, the developer can modify the generated forms without troubles.

    With only some mouse clicks, the developer obtains an application .

    More important, the developer uses standards Visual Basic controls. Their proprieties are the link between the visual controls and the AS/400 Databases fields.

    It’s not necessary to write a code to read, display or upgrade the data

    All the controls, Text, Label, Check, DBGrid, are integrated in Advanced Client Easycom/400 for VB.

    Advanced Client Easycom /400 was designed to answer the principal complaints about ODBC:

    Compare the lab results below with what you are getting with ODBC:

    Advanced Client Easycom/400 Components

    Advanced Client Easycom/400 middleware
    VB  AS/400 objects RemoteCommand/400 Data Queues/Area
     Function  Records Access Communicate with AS/400 objects Access Native Objects

    Copyright © 1998, MIS Systems Corp.
    Last updated June 2, 1998