devxlogo

Tip Bank

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

JVM Process ID

Question: On a POSIX-compliant system, is there a way to get the process ID ofthe JVM running the current code? Answer: There is no standard means of obtaining the process

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”.

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

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

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

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

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

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