devxlogo

February 13, 2001

How to Compact Databases Using ADO

To compact MDB databases using ADO, just include a reference to the ‘Microsoft Jet and Replication Objects 2.6 Library’ (distributed with the MDAC 2.6 package) in your VB project. The

JTextfield For Digits Only

Subclass PlainDocument, then set the document of the JTextfield to the subclass as shown below: JTextField myJTextfield;myJTextfield.setDocument(new DigitsDocument());class DigitsDocument extends PlainDocument { public void insertString(int offs, String str, AttributeSet a)throws

A Fast Recordset Loop

Opening recordsets as ForwardOnly or ReadOnly makes them move faster between records. In addition, storing fields to variables before begining the loop speeds up field access. Example: * Create a

Confining Your Mouse to a Form

With Modal forms there is a need to restrict the movement of the mouse to the form until user closes the form. This can be achieved by using the ClipCursor

Problems With Using Duplicate Variables

Most beginners accidentally declare duplicate variables of different data types or of the same data types. The following illustrates this: class Duplicate{ String data; private void fun() { String data=