The Latest

DevX - Software Development Resource

Simple JavaScript Alphabet

One obvious way to display or filter large recordsets is alphabetically. This function will take a page file and an optional frame name (defaults to _self) and create a row

DevX - Software Development Resource

Create a Link That’s Really a Function Call

You can call a function from a link, instead of opening a new location, by assigning the function to the anchor tag’s href attribute, like this: Click here Notice that

DevX - Software Development Resource

How to Pass a Variable into Report

Question: When I use a datawindow to generate a custom report, how can I pass a variable into the report from an input field? Answer: You can do this through

DevX - Software Development Resource

“Out of Memory” Error

Question: About halfway through compiling a 32-bit EXE with PB 6.5 on Windows NT, I keep getting an “out of memory” message box and then another that says “DDE Server

DevX - Software Development Resource

SQL Comments

Question: Can I insert comments inside a SQL query, like &#47&#42 &#42&#47 and &#47&#47in C++? Answer: SQL supports &#47&#42 and &#42&#47 for comments inside stored procedures and queries. You also

DevX - Software Development Resource

Performance of Joined Tables

Question: I have several tables with the same structure and I’m trying to combine them all into one unique table. But I’m worried about performance because each table has a

DevX - Software Development Resource

IIS Applications

Question: When I try to create a new IIS app,I receive an error message: “IIS or peer web services 3.0 or latermust be installed,” but IIS is installedand running on

DevX - Software Development Resource

Different Versions Coexisting on Same Machine

Question: Can three versions of PB (5.0, 6.5, and 7.0) coexist on the same machine without any problems? Answer: I am running PB5.0.4, PB6.5, and PB7.0.1 on my home and

DevX - Software Development Resource

Determining Variable Length

Question: How do I test the number of ‘characters’ contained within a given variable? Answer: Try this: Debug.Print “Length: ” & Len(CStr(X)) Once you convert a variable to a string,

DevX - Software Development Resource

ADO Events

Question: How do I use the ADO events FetchProgress or FetchComplete? Answer: If you want to use these, they work just like other events generated by other objects. When you

DevX - Software Development Resource

Insert Column into Table

Question: What is the proper syntax to insert a column into an existing SQL table? Answer: Here’s the syntax to add a column to a table: ALTER TABLE Employees ADD

DevX - Software Development Resource

Accessing Multiple Databases from a Datawindow

Question: Using a single datawindow, can I access data from multiple databases (Oracle and Sybase)? If not, can I use PowerBuilder to access it without having any intermediate table? Answer:

DevX - Software Development Resource

The unique() Algorithm

STL’s unique() algorithm eliminates all but the first element from every consecutive group of equal elements in a sequence of elements. unique() takes two forward iterators, the first of which

DevX - Software Development Resource

Signed Bit Fields

A bit field can be signed or unsigned. According to the C++ standard, a signed bit field may be represented in one of three ways: two’s complement one’s complement sign

DevX - Software Development Resource

Creating Immutable Constants

Although usually I don’t recommend using macros in C++ code, there are a few exceptions. One such exception is when you want to create a truly immutable constant. Consider the

DevX - Software Development Resource

Undoing a Macro

If you happen to define an object or a function or a constant whose name collides with a macro located elsewhere in a third-party header file, as in: // file

DevX - Software Development Resource

Take Advantage of Open Source Products

Open source products come with their source code files. Although you can usually install a ready-made executable file, you want to take advantage of the available source code files and

DevX - Software Development Resource

The Scope of Enumerators

The members of an enumerated type are called enumerators. For example: enum Direction { Up, // an enumerator Down // another enumerator }; int main() {} An enumerator’s scope is

DevX - Software Development Resource

Porting Code to a Different Compiler

I receive many questions from readers asking for guidance on how to port an existing C++ app to a different compiler or platform. Porting software can be very easy or

DevX - Software Development Resource

Accessing an Object From Another Process

On modern operating systems, a process consists of an executable file that the OS loads into the system’s memory and executes. A process normally has an entry point and one

DevX - Software Development Resource

Table Columns

Question: How do I drop a table column? Answer: To drop a column, use this syntax: ALTER TABLE Employees DROP COLUMN HomePhone Just remember that you can’t drop a column

DevX - Software Development Resource

Constructor for a Protected Class

Question: How do I create a constructor for a protected member of a class? I have declared the function in the header file but not defined the definition.The error message

DevX - Software Development Resource

Visual Basic Data Access, ADO, OLE/DB

Question: What are the differences between Provider=MSDASQL.1 and Provider=SQLOLEDB.1 in an “Open” “Select” statement? Also, what is the difference (if any) between “ADO” AND “OLE/DB”? And finally, in Visual Basic,

DevX - Software Development Resource

Deadlock Timeouts

Question: I have two questions: 1. How can I determine what the server’s lock mode currently is (e.g. WAIT, NO WAIT, etc.), without actually setting it at the same time?

DevX - Software Development Resource

Outer Joins in Where Clause

Question: What’s the syntax for outer joins in the where clause in Informix? Answer: The syntax is: SELECT c.customer_num, c.lname, c.company,c.phone, u.call_dtime, u.call_descrFROM customer c, OUTER cust_calls uWHERE c.customer_num =

DevX - Software Development Resource

Getting CGI Output

Question: Using C or C++ for CGI programs, is there a way to make a CGI program that calls another CGI program, and then takes the output of that called

DevX - Software Development Resource

uniqueidentifier vs. int

Question: If I have the option of using the uniqueidentifier or int data type for a primary key, will choosing the uniqueidentifier mean a significant performance degradation? Answer: The uniqueidentifier