HighDots Forums  

testing for empty memo field

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss testing for empty memo field in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Durwood Edwards
 
Posts: n/a

Default testing for empty memo field - 11-01-2004 , 02:17 PM






How should I write a test for Access memo field to see if it is empty?
I have tried:

IF(Recordset1.Fields.Item("duty2").Value)<>" " then
Response.write"2. "& (Recordset1.Fields.Item("duty2").Value)& "<br>"
else
response.write"2. Empty"
end if


this way will properly print the numeral indicated if the field is not empty
but will not print the contents of the field. What am I missing?
Thanks
Durwood



Reply With Quote
  #2  
Old   
cmbergin
 
Posts: n/a

Default Re: testing for empty memo field - 11-01-2004 , 04:17 PM






You're only missing the fact that memo fields can only be retrieved once on a
page. StrDuty = Recordset1.Fields.Item(&quot;duty2&quot.Value If StrDuty
&lt;&gt; &quot;&quot; Then Response.Write(&quot;2. &quot; &amp; StrDuty &amp;
&quot;&lt;br&gt;&quot Else Response.Write(&quot;2. Empty&quot End If


Reply With Quote
  #3  
Old   
Durwood Edwards
 
Posts: n/a

Default Re: testing for empty memo field - 11-01-2004 , 04:46 PM



Thanks

Jon Spivey sent me this explanation of your idea:
To get memo fields to display correctly you need to name them last in your
Quote:
sql and then assign them to a string before printing them, so
%
set rs=Connection.excute("select field1, memofield from table")
str= rs(1)
if str & "" <> "" then
' empty
else
' not empty - write it out
end if
%

Jon
"cmbergin" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
You're only missing the fact that memo fields can only be retrieved once
on a
page. StrDuty = Recordset1.Fields.Item(&quot;duty2&quot.Value If
StrDuty
&lt;> &quot;&quot; Then Response.Write(&quot;2. &quot; &amp; StrDuty
&amp;
&quot;&lt;br>&quot Else Response.Write(&quot;2. Empty&quot End If




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.