We help IT Professionals succeed at work.

Selecting for 'null' in an sql string with dao 3.6

rdolivaw
rdolivaw asked
on
Medium Priority
193 Views
Last Modified: 2010-05-02
I have an application that was referring to dao 3.51 for accessing an Access 97 database. Since the organization is in the process of upgrading to Office 2000 I need to change the reference to dao 3.6.  However, when I do so, the code line

set rsExport = dbExport.OpenRecordset("select * from export where out = '' or out = null", dbOpenDynaset)

no longer returns any records. Resetting the reference to dao 3.51 brings up 140 records, all with null in the field "out".

What am I missing here?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012
Commented:
Change your query to:
select * from export where out = '' or out Is null

Anthony
CERTIFIED EXPERT
Top Expert 2012

Commented:
This is described in great detail in the following article in MSDN:
PRB: Query Testing for NULL in Access Database Does not Return Records with Jet 4.0 (Q237992)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q237992

Anthony

Author

Commented:
Thanks, Anthony. That was just the ticket. I guess continuing education is required, just to keep up. Couldn't they have made it work either way for us poor, benighted souls? Oh, well

Richard.
CERTIFIED EXPERT
Top Expert 2012

Commented:
They could have.  But Microsoft would like to see you using ADO rather than DAO.

Anthony

Author

Commented:
I gotta get some training -- this OJT only works so far.

Thanks again.

Richard

Explore More ContentExplore courses, solutions, and other research materials related to this topic.