BCS Yii Populate Array With Database Content

To fetch an array containing database values the Yii active record facility offers a nifty solution for achieving the desired overall effect.

$sql = 'SELECT * FROM slnk t order by t.lkn';
$query = Yii::app ()->db->createCommand ( $sql )->queryAll ();
foreach ( $query as $row ) {           
    ?>
         // Include statements to generate here
    <?php
    }
    ?>

There is no need for external connection modules or adding other files to the MVC stack, Yii handles it all for you. When you change databases none of this code requires updating.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC 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 Select Distinct Date From DateTime

There are those occasions when the distinct date needs to be displayed from date time values. Considerable coding and displaying results via a list box control is one way to accomplish this feat.

On the other hand you could let SQL handle the gory details. In an ADO situation the following statement handles the request quite nicely.

select distinct CAST(datafieldname as date) from databasetable

The result set will contain distinct dates for the target table.

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