Solved

Comparing to NULL!!!!!

Posted on 1998-10-29
2
543 Views
Last Modified: 2008-02-01
Experts,

I can't compare a null value to the keyword null.

I am working with a recordset.  I am taking the value by:

value = datdata.Recordset!FIELD3

if this value is null, this will not work:
------------------------------------------------------------------
if datdata.Recordset!FIELD3 = Null then
   msgbox("This is null")
end if
------------------------------------------------------------------
when I go to debug, datdata.Recordset!FIELD3 is null!!!! What the heck is going on?  Is visual basic 5 buggy??

Thanks.
0
Comment
Question by:RickP101398
2 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 100 total points
ID: 1442420
if isnull(datdata.Recordset!FIELD3) then
   msgbox("This is null")
end if

See IsNull Function in VB Help
0
 
LVL 1

Expert Comment

by:rayford
ID: 1442421
is VB5 Buggy here are the official listed bugs fixed in VB6 (this are just the ones they FIXED in VB6 mind you)  Are you sitting down?  One Hundred Fifty Nine Microsoft Proud Bugs!!

1.       "FIX: StillExecuting Property Returns Incorrect Value
      Excerpt from this page: When attempting to compare the StillExecuting property with True, the comparison may fail even though the Microsoft Internet Transfer control is still executing its last Execute Method. This may result in the error: Run-time error 35764 Stil... (size 8,039 bytes, updated 8/7/98 7:00:00 PM GMT)
2.       "FIX: Controls on Nested Frames on SSTab May Paint Incorrectly
      Excerpt from this page: Controls located inside two nested frames located on an SSTab control may not repaint correctly at run-time when resized if the SSTab control they are located on was made visible immediately prior to resizing the control. The incorrect repaint vari... (size 8,113 bytes, updated 11/7/97 7:00:00 PM GMT)
3.       "FIX: Toolbar Performance Degrades with Dynamic Modification
      Excerpt from this page: Continually changing the Image properties of buttons on a Toolbar control results in an increased refreshed rate. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug h... (size 7,593 bytes, updated 10/24/97 7:00:00 PM GMT)
4.       "FIX: Internet Transfer Control Using Username and Password
      Excerpt from this page: The Internet Transfer Control is unable to make authenticated connections for either the HTTP or FTP protocols. Anonymous connections still work. If you try to specify the Username and Password, you will get the following error: Run-time error ... (size 9,216 bytes, updated 12/1/97 7:00:00 PM GMT)
5.       "FIX: Problems Shutting Down When Using the Inet Control
      Excerpt from this page: The IDE and Visual Basic-created .exe files hang when shutting down if they have used the Internet Transfer Control in their project. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this... (size 9,422 bytes, updated 12/1/97 7:00:00 PM GMT)
6.       "PRB: App Generates Run-Time Error 3633 When Run on New Machine
      Excerpt from this page: When building setup disks for a Jet-based database application with the Setup Wizard, the Setup Wizard doesn't include the Microsoft Jet database engine files. When you install the application and try to run it, you get the following error: Run... (size 8,195 bytes, updated 8/6/98 7:00:00 PM GMT)
7.       "FIX: Memory Leak Occurs After Form is Unloaded
      Excerpt from this page: A memory leak occurs in a Visual Basic project that has forms that are loaded and unloaded several times. CAUSE ===== The small icon of a form remains in memory after the form is unloaded, which results in a memory leak. RESOLUTION To work arou... (size 8,178 bytes, updated 9/26/97 7:00:00 PM GMT)
8.       "FIX: Cannot Change Variant Array in Class Module
      Excerpt from this page: In Visual Basic 4.0, an array stored in a variant class variable could be changed from code external to the class. In Visual Basic 5.0, changing values in the array will have no effect. CAUSE ===== The behavior of Visual Basic 4.0 was incorrect. ... (size 8,681 bytes, updated 9/18/97 7:00:00 PM GMT)
9.       "FIX: Memory Leak When RDC Bound to OLE Container Control
      Excerpt from this page: Using an OLE container control bound to the Remote Data Control that ships with Visual Basic 5.0 Enterprise Edition could result in a memory leak. This problem does not occur when using an OLE container with a standard data control. STATUS ======... (size 6,671 bytes, updated 12/19/97 7:00:00 PM GMT)
10.       "FIX: Change Event Not Fired When Selecting an Item in DBCombo
      Excerpt from this page: With Visual Basic 5.0, prior to Visual Studio 97 Service Pack 2, the Change event of the DBCombo control does not fire when the user makes a selection from the drop down list. This behavior is different from previous versions of Visual Basic. STAT... (size 6,958 bytes, updated 12/19/97 7:00:00 PM GMT)
11.       "FIX: Problems Updating Using DBCombo When ListField = DataField
      Excerpt from this page: Entering data with the DBCombo control may not update the underlying database if the ListField and DataField properties reference the same column. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the begi... (size 6,536 bytes, updated 12/19/97 7:00:00 PM GMT)
12.       "FIX: Bound Controls Built in VB 5.0 Don't Work in VB 4.0 IDE
      Excerpt from this page: Bound controls built with Visual Basic 5.0 may not correctly display data when used in the Visual Basic 4.0 development environment. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this ... (size 6,720 bytes, updated 12/19/97 7:00:00 PM GMT)
13.       "FIX: RDO May Incorrectly Handle Locking Conflicts in Transaction
      Excerpt from this page: An RDO query that cannot complete due to an uncommitted lock from a competing transaction may cause the query to hang rather than time out after the connection or query's QueryTimeout value. STATUS ====== Microsoft has confirmed this to be a bug ... (size 6,569 bytes, updated 12/19/97 7:00:00 PM GMT)
14.       "FIX: DBCombo Click Event Fires During Form Load
      Excerpt from this page: The DBCombo control's Click event fires during the Form's Load event. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Studio 97 Service Pa... (size 6,687 bytes, updated 12/19/97 7:00:00 PM GMT)
15.       "FIX: VB 5.0 DBCombo May Display Wrong Column for RDC 1.0
      Excerpt from this page: When the DBCombo that ships with Visual Basic 5.0 is used in conjunction with the RemoteData control that ships with Visual Basic 4.0 Enterprise Edition, the DBCombo may not display the correct column. STATUS ====== Microsoft has confirmed this t... (size 7,042 bytes, updated 12/19/97 7:00:00 PM GMT)
16.       "FIX: Using Set for ListItem's SubItem Results in GPF
      Excerpt from this page: Using the Set keyword when setting the value of a ListItem's SubItem results in a General Protection Fault. CAUSE ===== The SubItems collection of the ListItem is designed to handle strings, not objects. RESOLUTION Do not use the Set keyword. I... (size 7,116 bytes, updated 12/19/97 7:00:00 PM GMT)
17.       "FIX: RISC: CByte Doesn't Fail on Negative Values in Native Exe
      Excerpt from this page: In a native executable, passing a negative value to the CByte function does not generate an error. It should cause an Overflow error. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this... (size 6,955 bytes, updated 12/19/97 7:00:00 PM GMT)
18.       "FIX: Bound Controls Built in VB5 Do Not Work in VB4 IDE
      Excerpt from this page: ... (size 6,523 bytes, updated 12/18/97 7:00:00 PM GMT)
19.       "FIX: Problems Updating Using DBCombo When ListField = DataField
      Excerpt from this page: Entering data with the DBCombo control may not update the underlying database if the ListField and DataField properties reference the same column. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the begi... (size 6,533 bytes, updated 12/18/97 7:00:00 PM GMT)
20.       "FIX: Problems Retrieving VB 5.0 Projects from Visual SourceSafe
      Excerpt from this page: Retrieving a project from Visual SourceSafe into Visual Basic 5.0 may result in one of the following errors: Failed to reload project .... -or- Application error -or- The instruction at '0x0fa659de' referenced memory at '0x303... (size 6,681 bytes, updated 12/18/97 7:00:00 PM GMT)
21.       "FIX: Change Event Not Fired When Selecting an Item in DBCombo
      Excerpt from this page: With Visual Basic 5.0, prior to Visual Studio 97 Service Pack 2, the Change event of the DBCombo control did not fire when the user makes a selection from the drop-down list. This behavior is different from previous versions of Visual Basic. STATU... (size 6,942 bytes, updated 12/18/97 7:00:00 PM GMT)
22.       "FIX: Problems Binding Controls to Nonexistent Data Control
      Excerpt from this page: Setting the DataSource property of a control to the name of a data control that does not exist may cause a GPF with the following information: Visual Basic 5.0 caused an invalid page fault in module KERNEL32.DLL at 0137:bff78053 STATUS ==... (size 7,297 bytes, updated 12/18/97 7:00:00 PM GMT)
23.       "FIX: Memory Leak When RDC Bound to OLE Container Control
      Excerpt from this page: Using an OLE container control bound to the Remote Data Control that ships with Visual Basic 5.0 Enterprise Edition could result in a memory leak. This problem does not occur when using an OLE container with a standard data control. STATUS ======... (size 6,598 bytes, updated 12/18/97 7:00:00 PM GMT)
24.       "FIX: Selected Tab Changes After Removing Tab in Tabstrip
      Excerpt from this page: When removing a tab from a Tabstrip control at run-tim
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now