November 6, 1999

Create and delete DSN at runtime

If you’re developing a VB database application, you’re probably using a DSN (data source name) because it makes the access to your database file easier. Of course, when you distribuite your application, you must create the DSN. There are some installation programs that offers the possibility to create the DSN

Speed up Recordset creation with the CommandType property

If you want to create an ADO Command using VB code, remember to always set the CommandType property to the appropriate adCmdxxxx constant value. If you don’t this, will be used the default adCmdUnknow value, and the Data Provider must test the CommandText property to determine if it is a

Two handy functions for Null handling

You’re probably aware that most VB functions don’t work well with Null values, which is an issue when you’re working with database columns that can accept Nulls. For example, the following statement: Dim s as Strings = rs.Fields(“AnyField”) can raise error 94 “Invalid use of Null”. The usual workaround is

Catch user’s attention with a flashing caption

If you want to draw user’s attention but you don’t want to force the form to move to the foreground, you can simply flash its caption (and its icon in the taskbar), using the FlashWindow API function. To do so, just add a Timer with a suitable Interval property (for

Format a String from Database that has line Feeds and Carriage Returns

If you’re displaying a long string, which contains line feeds and carriage returns, then replace those ASCII characters with something that will format the string before displaying the same to the user. Example: sStringToDisplay = Replace (sStringFromDatabase, chr(13) & chr(10),””)

A Member Function Template may not be Virtual

A reader tried to declare a template as a virtual member function of a class. However, his compiler refused to compile the code. The reader wanted to know what he was doing wrong. The answer is simple: the ANSI/ISO Standard says (14.5.2 p 3): “A member function template shall not

Structured Exception Handling and Standard Exception Handling

Many C compilers provide a non-standard feature called “structured exception handling”, or SEH for short. SEH can trap asynchronous, platform-specific exceptions such as division by zero, floating point overflow and underflow, and other hardware exceptions. In contrast, the standard C++ exception handling (EH) applies only to synchronous exceptions, i.e., exceptions

Always Prefer to use Same Language

You should always prefer to use one language in your Web pages.When you use both VBScript and JavaScript on the same page, bothscript engines are loaded into memory. Simply rewriting your code to useonly one language will make your pages faster. This is a common mistakethat many DHTML developers make

Switch off the Automatic Distribution Statistics Management

The SQL Server 7.0 automatically recalculates the table’s distribution statistics when the number of changes reaches some predefined values. This automatic recalculation of the distribution statistics can cause problems such as decreased performance on the server. However, to avoid this you can turn off this recalculation by turning off automatic

No more posts to show