Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for 'NULLS' in recordsets

Status
Not open for further replies.

JazzLeg

Programmer
Aug 22, 2002
63
GB
Hi,

I need to be abvle to read a field from a recordset (from SQL 7) and if the field is null then I would like to take an action....

I've tried this:

Code:
if rs("field") is null then....
but this gives me an error "object required" even tho all my variables are declared.

thanks
 
if the default is null in the database the VarType of the returned data will indicate it is null

To test for this try

if( VarType ( objRS("someData") = 1 ) ) then
Response.write "Data is null"
else
Response.write "Data is not null"
end if


Hope this helps



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top