Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

a value of Null in Visual Basic Professional 4.0

0 views
Skip to first unread message

Eric B. Ridge

unread,
Feb 11, 1997, 3:00:00 AM2/11/97
to

Hello all,

I'm been asked to do a front end for a small MS Access Database and I've
run into something I can't figure out.

In Access, if a field contains nothing it's value is NULL. so when I
retrieve this value in my VB App my Recordset = Null. Null in VisualBasic
indicates that the variable has no value. It does *NOT* indicate a value
of 0 (zero) like it would in C. And when I try to use the Null variable VB
complains. How can I check to see if a variable is Null? A Simple IF
data.Recordset (x) = Null THEN . . . doesn't seem to work.

Any information will be greatly appreciated.

thank you.

eric ridge
ebr...@ebridg.vnet.net

Noam

unread,
Feb 11, 1997, 3:00:00 AM2/11/97
to Eric B. Ridge

Eric B. Ridge wrote:
>
> Hello all,
>
> I'm been asked to do a front end for a small MS Access Database and I've
> run into something I can't figure out.
>
> In Access, if a field contains nothing it's value is NULL. so when I
> retrieve this value in my VB App my Recordset = Null. Null in VisualBasic
> indicates that the variable has no value. It does *NOT* indicate a value
> of 0 (zero) like it would in C. And when I try to use the Null variable VB
> complains. How can I check to see if a variable is Null? A Simple IF
> data.Recordset (x) = Null THEN . . . doesn't seem to work.

There are a set of functions in Visual basic, Is<something>(). The one
you need is IsNull() (i.e. If IsNull(data.RecordSeT(x)) = True then...).
You might want to look at the other in the helpfile as well, they can be
very useful.

Noam
--------------------------------------------------------------
Noam - ja...@islandnet.com.NOSPAM
My Homepage: http://www.islandnet.com/~jano/

The ".NOSPAM" at the end of my E-Mail address is an attempt to stop
automatic bulk mailers from getting my address. You need to remove it
when sending me mail.

0 new messages