
346
|
Chapter 12: The Language Reference
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Syntax
Dim result As Boolean = IsDate(expression)
expression (required; any)
Expression containing a date or time
Description
The IsDate function determines if an expression can be interpreted as a date without
error (
True) or not (False).
Usage at a Glance
• Uninitialized Date variables return True.
• IsDate uses the regional settings of the local system to determine if the value is
recognizable as a date. What is a legal date format on one machine may fail on
another.
See Also
CDate Function
IsDBNull Function
Class
Microsoft.VisualBasic.Information
Syntax
Dim result As Boolean = IsDBNull(expression)
expression (required; any)
The expression to be evaluated against System.DBNull
Description
The IsDBNull function determines whether expression evaluates to System.DbNull
(
True) or not (False).
Usage at a Glance
• DbNull is not the same as Nothing or an empty string. DbNull is used to denote a
missing or nonexistent value, and it is used primarily in the context of database
field values.
• Because of the way that VB deals with expressions containing DBNull, you cannot
simply compare a variable to DBNull, as in:
If (someVariable = DbNull) Then
You must make the comparison using the IsDbNull function.
If (IsDBNull(someVariable) = True) Then
Version Differences
• The