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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recordset has empty field - how to verify 2

Status
Not open for further replies.

craiogram

MIS
Feb 20, 2004
126
0
0
US
I have spent he last 2 days looking for this info in a past thread but couldn't find anything. I have a recordset that has a field that has nothing it in. I have tried the following to verify but it is not working. Please advise.

Code:
if rsMemInfo("picks") = " " then
Response.Write("NO selections made.<BR>")
else
Response.Write("USER made selection.<BR>")
end if

also tried:
if rsMemInfo("picks") = "" then
if IsNull(rsMemInfo("picks")) then
if IsEmpty(rsMemInfo("picks")) then

none work to capture when the database (Access) holds nothing in that field.
Thank you in adavance,
Allan
 
If the field is fixed-length, it may not be null or the empty string, it may contain spaces. Have you tried trimming off trailing spaces before comparing against the empty string ("")?
Code:
if trim(rsMemInfo("picks")) = "" then

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
I ran into the same thing a while back and someone here gave me this solution. I THINK it was DotNetGnat but might be mistaken.

myvalue = trim(rs(0) & "")

This way if the value is null it gets assigned an empty value instead.


Paranoid? ME?? WHO WANTS TO KNOW????
 
That did it!! thank you and thank he who helped you .. potentially DotNetGnat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top