Solved

ASP/ADO bug with SQLserver

Posted on 1998-08-13
4
201 Views
Last Modified: 2010-03-19
Im creating a recordset from ASP with the following query (the recorset type is forward only, no lock, textual command);

SELECT *  FROM core WHERE empvis != null AND eNews=1

eNews is a bit datatype and empvis is datetime (with nulls) . When I run it from ASP, it returns nothing, yet running from the SQL tool in Enterprise manager it returns lots (what I want). If I remove the eNews=1 bit then I do get data returned via ASP. Is this an ADO bug - any workarounds?

Matthew Allum
0
Comment
Question by:matthewallum
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Wiz_of_Oz
ID: 1089546
what r the results of the qry
SELECT * FROM core
r they correct?
0
 

Author Comment

by:matthewallum
ID: 1089547
yep
0
 
LVL 4

Accepted Solution

by:
mitek earned 50 total points
ID: 1089548
Of course, it will return nothing. It's not a bug in ASP/ADO, but a bug in the query.
Instead of writing
SELECT *  FROM core WHERE empvis != null AND eNews=1 ,
try
SELECT *  FROM core WHERE empvis IS NOT null AND eNews=1

Your query is not supposed to return anything, because any comparison ( =, !=, >, <) to null will render FALSE value.
Thus, the whole expression is false and no rows are selected.
 
0
 

Author Comment

by:matthewallum
ID: 1089549
Thanks ! makes sense now and works ;)
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

815 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

8 Experts available now in Live!

Get 1:1 Help Now