The Latest

DevX

Include Guards

#including a file more than once during the same compilation session will most likely cause the compiler to issue error messages since definitions and declarations of the file are repeated.

DevX

Seed the Random Number Generator

You can use Rnd followed by Randomize to seed Visual Basic’s random number generator. Whenever you use the same seed, Rnd produces the same sequence of random numbers: Rnd -1Randomize

DevX

Better Auto-Propercase

The “Auto-Propercase Text Box at Entry” tip [VBPJ May 1997, page 63] has a simpler solution. The StrConv function can propercase any string. You can achieve the same effect with

DevX

Convert from Fractional to Decimal Numbers

While developing a database front end for hand-tool management, I discovered a need to handle both fractional and decimal representations of dimensions in the same text box. This makes it

DevX

Avoid Form Confusion

When you define a form named MyForm, Visual Basic creates one instance with the name “MyForm.” Many programmers confuse this special instance with other instances created using Dim. For example,

DevX

E-mail Address Syntax

Question: We want to begin collecting customer e-mail addresses from our Web site. Our current file system is mainframe based, storing all data in uppercase format. Are e-mail addresses case

DevX

Optional Parameters in ASP

Question: In my Visual Basic ActiveX DLLs, some of the methods that I created for my objects use optional parameters. When I attempt to call these methods, I receive a

DevX

Side-by-side Tables

Question: I have noticed that some sites have tables that sit side-by-side. I can never duplicate this behavior with my HTML scripts. Do you have any suggestions? Answer: Positioning two

DevX

The Type-name Keyword

A type-name is merely a placeholder that has to be substituted with a proper type. For example: template T min( const T& first, const T& second); //T is a type-name,

DevX

Make Sure Data is Safe Before Unloading

To decide when it is safe to exit your program, use a DataUnsafe function. Set the DataModified variable to False when you load or save data, or when you start

DevX

using COUNT and GROUP BY with zero-values

Question: I’m trying to query our Human Resources database to find the number of temporary employees in each department. I’m using the following SQL statement: select count (*)from employeewhere status

DevX

query

Question: I have a table like this: name cat1 cat2—- —— —–A 1 orangeA 1 orangeB 1 appleB 1 appleB 1 appleC 2 bananaC 2 bananaC 2 bananaC 2 banana

DevX

adding records but not using primary key

Question: Is there any other way apart from using the INSERT INTO command that allows you to append a line to a database? I have a primary key “ID,” but

DevX

Can PB act as a COM Server

Question: I am working with a client that has a Powerbuilder application. We need to call that app through a variety of APIs. The client says that they cannot act

DevX

Sorting

Question: I have a select query “Select * from Table where ID in (8, 2,3,78,32,1,7)” that I want returned in the same order that the IDs are in in the

DevX

SQL order by count

Question: I need to know how to order by the count of the selected field. For example: Select xxx count(xxx)from prod-tableorder by xxxI’d like to order/rank field xxx highest to

DevX

Connection Limits to SQL Server?

Question: Is there a limit to the number of connections to an SQL server? If so, how many connections are permitted at one time? Answer: The number of connections is

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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

DevX

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