Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2004, 03:43 PM
Registered User
 
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default testing for empty Access memo field

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

 
Old November 1st, 2004, 05:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Durwood,

You are checking if it has a SPACE, not for EMPTY which is DOUBLE double quotes without space inbetween. It might also have NULL which is nothing but somthing, not EMPTY. So you should be changing your IF to the following one.
Code:
IF Len(Recordset1.Fields.Item("duty2").Value))>0 then
    Response.write "got something in it"
ELSE
    Response.write "EMPTY"
END IF
Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old November 3rd, 2004, 04:17 PM
Registered User
 
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually the problem arose from the fact that an Access memo field can only be retrieved once. Copying the field content to a variable solved the problem.

 
Old November 9th, 2004, 09:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Actually the problem arose from the fact that an Access memo field can only be retrieved once. Copying the field content to a variable solved the problem.
So where does that value go once retrieved from the recordset, does that erase the value from recordset? I am not sure if that can be retrieved only once. I haven't heard about that yet. May be you can use that as the last item in the SELECT list. That should do the trick.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo Field Brendan Bartley Access 11 December 13th, 2007 04:28 PM
Memo field not displaying meichmann SQL Server ASP 3 August 31st, 2006 11:36 AM
Inserting data into an Access memo field with SQL jhunta VB How-To 3 September 20th, 2005 02:49 PM
Problem with memo field in Access 97 Ardeshir Access 4 December 27th, 2004 06:05 AM
Access update memo field problem mar0364 Access ASP 0 March 25th, 2004 04:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.