devxlogo

April 30, 2002

Avoid Copying Data

You can use the name of a Function or Property Get procedure as a local variable anywhere in the procedure. If your procedure returns a String or UDT type, writing

Determine a Control

To determine whether a control is a member of a control array, you can reference its Index property and handle the generated error when the control is not in an

Ascertain OK or Cancel From the InputBox

When the user presses Cancel on a VB InputBox, the string returned is a vbNullString. If the user inputs a zero-length string and presses OK, the return string is empty

Force Tri-State Checkbox Cycling

The CheckBox control in VB supports three positions: Checked, Unchecked, and Grayed. Unfortunately, the default behavior for the control is to cycle between Checked and Unchecked. To set it to

Avoid Premature Object Creation

This is a simple tip that proves useful in the long run. Consider the following example: void someFunction() {Date d= new Date(); // The Date object is created outside the

Handling Single Quotes in a SQL Query

To insert data with single quotes, place 2 single quotes instead of 1 single quote, like this: create table MyTable ( Field1 varchar(10))goinsert MyTable (Field1) select ‘A1111”1111’ UNION ALL select

Insert Multi-Lingual Characters in JDBC

This method allows you to insert multi-lingual characters into an Oracle database. In this tip, the column type is varchar2. The multi-lingual string is converted to its unicode value and

Make a ResultSet Scrollable

This code can also be used to navigate through the Resultset backward or forward, or to perform insertions, deletions and updates to update the database. //load JDBC Driver// Get the