Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Nov 17, 1998



Application Security Testing: An Integral Part of DevOps

Dealing With Null Values Returned From RDO Resultsets

If you're assigning the values of columns you return from RDO queries into string variables, you'll get an "Invalid use of Null" error if one of the columns has a Null value. For most purposes, I'd rather have the value as an empty string anyway. Rather than code for that each time I access a column, I've written a function called Clean that turns Null values into empty strings. I call it like this:
I also convert Empty values as well, for use with Variants:
Public Function Clean(ByVal varData As Variant) As String

If IsNull(varData) Then
	Clean = ""
ElseIf IsEmpty(varData) Then
	Clean = ""
	Clean = CStr(varData)
End If

End Function
James T.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date