January 4, 2001

Exception Handling, Inheritance and the Need For Strict Rules

Java has some strict rules for exception handling when it comes to inheritance and overriding of methods.Consider this example: class Base { void amethod() { }}class Derv extends Base{ void amethod() throws Exception { } //compile-time error public static void main( String s[] ) { Base b = new Derv();

A Ranking Algorithm Implemented In One SQL Statement

We often come across situations where we have to rank things/persons based on certain criteria, such as ranking Students based on their scores.Take, for example, a SCORES table with two columns: STUDENT_IDVARCHAR2(10), SCORE NUMBER(5). To rank these Students based on their scores, a straightforward approach is to open a cursor,

Another Way of Handling Null Database Fields

A compact way of handling null database fields is as follows: txtText1.text = Format(rs!Field) If rs!Field is null, Format(rs!Field) will resolve to an empty string.Otherwise the value in the recordset field will be entered into the text box. This behavior of Format() is rarely noticed but is useful because it

Handling Dialogs With One Line of Code

Handle dialogs with one line of code by encapsulating the show method within the form in a public function. This makes the form/dialog reusable and simpler to implement and update. Example: Form: frmLogin Option Explicit Public Enum LoginReturns LoginFailed = 0 LoginSuccess = 1 End Enum Private mReturn As Long

View Recordsets in Temporary Grids

An alternate, convenient way to view recordsets in debug mode is to persist a recordset to disk using rs.save MyFileUNC.ADTG in the immediate window. Note that the file must be of ADTG type (*.adtg). The recordset may then be viewed on a grid in the same application (or on a

A Powerful and Simple Message Box Statement

This tip can be used as a Select Case statement with a MsgBox statement. Because a variable is not used to hold the response, adding one or more handles for response is easy. The statement renders a simple overview of the function of the code. Here is an example: Select

Adding Popup Menus to Custom Controls

Shipping custom controls with their own set of popup menu items make the controls appear appropriately professional. They add ease of use, functionality and value to the control(s). Here’s how it can be done:Add an invisible menu item to the control with one or more sub-menu item(s). The sub-menu item(s)

No more posts to show