BCS Clone A Record

There are those times when it would be helpful to clone an existing record in a table. With a few lines of code this is easily accomplished.

Establish a control to initiate the cloning action. I accomplished this by leveraging a menu item.

Within the menu item the following code will invoke the cloning mechanism.

procedure TBCSSslC.CloneARecord1Click(Sender: TObject);
begin
  BCSSsldm.atassr.InsertRecord([nil, BCSSsldm.atassrpoc.AsString,
    BCSSsldm.atassraddr.AsString, BCSSsldm.atassrreq1.AsString,
    BCSssldm.atassrdwa1.AsString]);
end;

The InsertRecord command works nicely for cloning the currently active record in a quick and dirty manner.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.

BCS Position Data Grid XE3

Initially we need to provide a mechanism to gather input information from the user. I have chosen to the InputBox control. The information from the InputBox control is then used to filter the data. The following code snippet shows how this process is completed.

procedure TBCSPwbLaunchC.FilterDatabase1Click(Sender: TObject);
begin
  BCSPwbLaunchdm.atapwb.Filter := 'sdes LIKE ' + '''' +
    trim(InputBox('Enter Initial Value', 'Key In Initial Value', '')) +
    '%' + '''';
  BCSPwbLaunchdm.atapwb.Filtered := true;
end;

Notice the ‘%’ appended to the filter string.  This per cent sign is the wild card designation for the filter.  The filter as coded tells the data table to return all records that begin with the string entered via InputBox with trailing information but do not include records that are less than or greater than the inputted string.

Conversely when we would like to turn off the filtering mechanism for the data records simply tell the table not to use a filter for the data by setting the Filtered option on the data component to false. The following code show how this is accomplished.

procedure TBCSPwbLaunchC.ShowAllRecords1Click(Sender: TObject);
begin
  BCSPwbLaunchdm.atapwb.Filtered := False;
end;

The following video demonstrates this feature in action.

The following filter examines the data field where the contains the specified string.  Notice the % before and after the keyed information specifies the contains filter.

{*-----------------------------------------------------------------------------
  Procedure: Contains1Click
  Date:      15-Dec-2013
  @Param     Sender: TObject
  @Return    None
 
-----------------------------------------------------------------------------}
 
procedure TBCSPwbLaunchC.Contains1Click(Sender: TObject);
var
  dcmd: string;
begin
  dcmd := trim(InputBox('Enter Contains Value Now!',
    'Key In Contains Value!', ''));
  if trim(dcmd) > '' then
  begin
    BCSPwbLaunchdm.atapwb.Filter := 'sdes LIKE ' + '''' + '%' + dcmd +
      '%' + '''';
    BCSPwbLaunchdm.atapwb.Filtered := true;
    RecordCount;
  end;
end;

Of all the approaches to quickly position the user to a specific set of records in the data table I have found this approach to be the most efficient.

If you believe you have a more improved approach to this problem please feel free to share with us by adding your comments to this post.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.

BCS ADO Support Replacement

The ActiveX Data Objects (ADO) has been useful in database management systems for connectivity and data manipulation. Many past application utilize this level of technology. Microsoft has announced that it will drop support for this ADO DBMS technology in the near future.

I have decided to leverage the component architecture of Delphi’s Visual Control Library (VCL) and employ a component set that replaces the ADO function.

The main advantage to this approach is the ODBC infrastructure is no longer required, Therefore DSN’s and UIL’s are no longer required. The replacement ODBC is to correctly replace so the aforementioned overhead is no longer required.

All features of ADO are available in the new VCL self-contained DBMS. The new technology also provides support for most of the popular DBMS’s like MySql, Oracle, SQL Server and others including Access. In all there numerous DBMS infrastructures supported and none of the require the ODBC overhead.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.

BCS Eclipse Luna SDK 4.4

The new Eclipse SDK Luna became available earlier last month and of course I procured a 64 bit copy and began tailoring it for production use.

Python 3.x is enabled flawlessly for utilization of all Python applications.

Groovy and Grails Tool Suite (GGTS) 3.4.0, Grails 2.3.6, Groovy 2.1.9, JVM 1.7.0_11 mixed mode, jquery 1.11.0, groovy pages 2.3.6 and hibernate 3.6.10.8 round out the grails development environment.

Php applications such as Yii 1.1.13 are also ready for service.

C, c++ Java, Ruby on Rails, FORTRAN, COBOL and HTML 5 interfaces are in place and ready for service.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.

Webmin Ubuntu Linux 12.10

Webmin is a productivity tool that is recommended. When server updates become available for Ubuntu 12.10 Webmin flags them and allows you to upgrade your server with the available updates. I recently had 93 updates to my server and I simply clicked one control and the updates began and ran until completion. Dependencies of updates were resolved, fetched and installed without intervention.

The File Manager tool is worth the time associated with the installation of Webmin but there are other features that deem Webmin as an excellent productivity for Ubuntu and other linux based operating systems.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.