The Latest

DevX

Date Arithmetic in Java

Question: I have a ResultSet created using JDBC and it contains some datefields. Now I want to subtract one date from the other. Howdo I do this? Answer: Date arithmetic

DevX

Reloading Java Classes in JSP Development

Question: How can I force a reload of a JavaBean that is being used in a JSPpage? The problem is I am developing a JSP-based Web application andI need to

DevX

Entering Information Into Two Tables at Once

Question: I have two tables: Items_table: Item_id (primary key) Description (foreign key) Item_priceDescrip_table: Description (primary key) Item_type How do I enter information into the two Description columns simultaneously? Answer: An

DevX

Changing a Column Name Within a Table

Question: Is it possible to change the name of a column within a table after it has been created? For example, I want to change the column “Name” to “FName”.

DevX

EXE Starts and Ends Immediately

Question: When I build my application as an EXE and run it, the application comes up and then immediately disappears. What is wrong? Answer: You need to create an event

DevX

Filling a Field with Data

Question: How can I fill a numeric field with a sequence of numbers using SQL? For example, I want a field named NUMBER to contain the numbers 1 for the

DevX

Restricting Users’ External E-mail Access

Question: We have a private WAN network with Exchange Server 5.5 and also have one inbound/outbound Internet mail service for all people to use to send Internet e-mail. I want

DevX

Not Wanting Table to Remain Read-Only

Question: I created a command button on the main form. It runs another wizard-generated form that edits a table in the database container. It works in test, but when I

DevX

Create a Context Menu

Question: I’m having a problem creating a context menu in a grid (by clicking on the right button of the mouse). I created this menu by programming a method that

DevX

OLE Automation of Word

Question: How do you open a specific Word document through a Visual FoxPro program? Answer: You simply add the document to the Word.Application’s Documents collection. Here is a code sample

DevX

Determine the number of mouse buttons

Sometimes is useful to know how many buttons the user’s mouse has. This value can be obtained by calling GetSystemMetrics. The constant to pass as parameter is SM_ CMOUSEBUTTONS. Here’s

DevX

Open a Control Panel dialog or wizard

Have you ever needed to open a Windows dialog such as Internet Properties, New Hardware, Modem Properties or any other dialog you can find in the Control Panel? Well, it’s

DevX

How did Windows start?

If you need to know how Windows was started you have just to call an API function: GetSystemMetrics. Passing the SM_CLEANBOOT constant as parameter, the function returns a Long value

DevX

Create a simple Windows inspector

It takes only a handful of lines of code to create Windows inspector program, that is, an utility that lets you display the handle, the class name and the contents

DevX

Open the Internet Connection dialog

The dialog you see when you start an Internet connection is implemented in the RNAUI.DLL file, and the specific function is called RnaDial. To open this dialog from your application

DevX

Hide the application in the Task List dialog

As you know, when you press CTRL+ALT+CANC the Task List window appears. This dialog allows you to see all the running processes and also to terminate them. If you don’t

DevX

Manipulate Dates With VBScript’s DateAdd Function

Browsers Targeted: Internet Explorer 4+ Dates can be a pain to deal with when working with scripting. Fortunately VBScript 5.0 supports a number of different functions that can simplify the

DevX

Add a Counter to Your Web Page With XHTML

Browsers Targeted: Internet Explorer 3+, Netscape Navigator 3+ You can take advantage of the new XHTML standard in your own code, regardless of your browser, to enhance the capabilities of

DevX

Forcing Data Entry in Uppercase

Question: I would like to force data entered into a form to be uppercase. This is probably basic, but I can’t figure it out! Answer: What you are looking for

DevX

Resizing Forms and Controls

ne of the more common questions here at Ask the VB Pro has always been how to automatically handle the resizing of forms and controls. Unfortunately, the short answer is

DevX

Convert Schemas to Documents

he way that XML is being used, of late, is beginning to send tremors throughout much of the programming world. Part of this has to do with an obvious logical

DevX

Unzipping Files with java.util.zip.ZipFile

he Java core packages include jave.util.zip, which is useful forcreating and reading compressed files or archives in the ZIP and GZIPformats. ZIP files form the basis for the JAR file

DevX

A Universal Data Format

Data types larger than the size of a byte aren’t portable because of the different endian-ordering of each hardware architecture. This means that passing an int in its binary form

DevX

The 80-20 Optimization Rule

It’s a fact that applications spend 80 percent of their time executing 20 percent of their code. Some even claim that the ratio is higher: 90-10. Usually, programmers can’t assess

DevX

Adding Object-Oriented Functionality to a POD Type

Sometimes, legacy code that contains Plain Old Data (POD) types (i.e., dumb structs that don’t have any member functions) can use an object-oriented “face lift”, e.g., adding a constructor or

DevX

Optimizing Nested Loops

Several compilers need this hint from the programmer while others are clever enough to figure it out automatically. When you have nested loops, declare the counter of the most deeply-nested

DevX

Inlining Virtual Member Functions

Generally, compilers can’t inline a virtual function call if the it’s resolved dynamically. Therefore, declaring a virtual member function inline might seem pointless. However, not every call of a virtual

DevX

Assign Image and Color Backgrounds in Table Cells

Browsers Targeted: Internet Explorer 4+ In Internet Explorer, you can assign images and colors into table cells and table rows through the background-image and background-color CSS attribute within style sheets.

DevX

XHTML: HTML Merges With XML

eb developers awake! XHTML (Extensible HyperText Markup Language) is coming to a server near you. It’ll change everything you ever knew about Web design, give you untold power on the