devxlogo

The Latest

Titles of SQL reports

Question: Is there a way to title report outputs in SQL? Answer: If you are creating a quick and dirty report, you can always add a title simply by putting

SQLServer Y2K Testing

Question: I have been asked as a SQLServer DBA to certify SQLServer 6.5 as Y2K compliant, apart from any statements from Microsoft. I am aware that Microsoft indicates that all

Problem with Filter function and char()

Question: I want to filter out data from a datawindow during runtime. I have a sle-field in which the user enters a search string (for example, “SM”). This should be

DataWindow Print Single Page?

Question: Can I print only one page in datawindow? Answer: Yes, you can set the print range of a datawindow, just like in Word or Excel. If you set the

Displaying the Row Number in a SELECT Query

Question: How can I display the row number in the results of a SELECT query? For example: Select empname from employees where city = “toronto” I would like to show

Inner Joins

Question: Is there a limit on the number of tables that can be joined in SQL? Answer: In SQL Server version 6.5 there is an upper limit of 16 tables

PL/SQL

Question: What does the PL stand for in PL/SQL? Answer: The PL stands for procedural. SQL is traditionally set-oriented. In many situations, a significant amount of procedural code must also

Creating Flexible Reports

Question: I have a problem making reports flexible. Let us assume we have a standard report, but it changes according to the situation. How can I allow users to change

A Pure Virtual Destructor

Unlike ordinary member functions, a virtual destructor is not overridden when redefined in a derived class. Rather, it is extended: the lower-most destructor first invokes the destructor of its base

Exported Templates Can Reduce Compilation Time

A template definition can be #included in several translation units (source files). However, each time it is #included the definition is recompiled. Using large template definitions can increase compilation time

How to Disable Further Derivation of a Class

In some rare cases, it is useful to disallow further derivation of a class. Classes that implement system API or sensitive security management are good examples for that. Declaring the

Standard Exceptions

C++ defines a hierarchy of standard exceptions that are thrown at run time when abnormal conditions arise, such as when operator new fails. The standard exception classes are derived from

Two Distinct #include Directives

The preprocessor #include directive appears in two flavors: #include < vector > // angular brackets and #include “myclass.h” // quotes The two are not interchangeable. The angular-bracket version applies to

Create a Globally Unique Identifier (GUID)

I use this routine in almost every application I develop. It’s handy whether you need a key for a collection or whether you use it in a database: Option ExplicitPrivate

Suspend Code While Waiting for Shelled Process

This “wait” routine suspends your code and waits for the shelled process to finish. It comes in handy when you need to run another scriptatch file during your process. Use

Use UNC Names to Refer to Network Drives

If you write programs that access information on a network server, you never want to hard-code drive letters. Not all software vendors take advantage of the Uniform Naming Convention (UNC)

More Tips for “Creating a Better Mouse Trap”

I would like to add a few things to the “Building a Better Mouse Trap” tip [VBPJ November 1996, page 56]. This approach also works for any message, including button-up

Send Messages to WinPopUp from Your Application

If you have an application that must run “unattended” and you want it to alert you if something goes wrong, your application can send you a message through WinPopUp. WinPopUp

PB6 interface to VB5

Question: How can I use VB5 components from within PB6? Can VB5 deliver a DLL that we can communicate with, or are there better methods? Answer: The best method of

Rich text set default font

Question: How do I control the font size in a rich text edit? I am pulling text from a variable and applying it to a rich text edit by: rte_1.SelectTextAll()rte_1.ReplaceText

Passing arguments to an Exe

Question: I have an .exe of PB app “sales.” While I type c:sales.exe, I will also pass a parameter such as c:sales.exe auto. Now I want to access this parameter

Wrapping Text in TextArea

Question: Is there a way to wrap text that is written to the TextArea? Answer: The java.awt.TextArea class does not have built-in support for wrapping text, but you can implement

Saving Panels with TextField?

Question: I am writing a presentation application and want to take a Panel and add TextFields and maybe Images to it. Is it possible to save this Panel with TextFields

TextField listeners

Question: I want to capture an event that signals a user’s completed update to a TextField. Answer: In general, a user will finish entering text in a TextField by pressing

Copy & Paste

Question: How can I copy the selected text from a TextArea to the system clipboard or paste from the system clipboard to a TextArea? Answer: Java 1.1 introduced the java.awt.datatransfer

Textediting functions in Java

Question: I’m trying to make a text editor in Java, andI want the editor to be able to make words and even pieces of words italic, bold, or underlined. It

HTML browser in Java

Question: I am tring to make a stand-alone application that can read HTML files and render them like a Web browser. How can I do this in pure Java? Answer:

Port information

Question: I need to take a port number as input froma user. How can I check if the port numberentered by the user is free and not beingused by any