Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 October 31st, 2003, 06:03 PM
Authorized User
 
Join Date: Jul 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Memo fields

I have an Access database with a table using a memo field. I am able to store data into that field, and I am able to retrieve and display data from that field. However, I cannot test the field for contents before displaying. Once I have applied an "if" statement to the field contents, it's as though the field is now empty. Displaying it with a response.write statement results in no data being displayed. Is ther a way around this problem?

Samples:
response.write("Show me " & rs("memo")
'displays the data perfectly

if rs("memo")>""
response.write("Show me " & rs("memo")
end if
' displays only the "Show me "

The same problem occurs no matter what method is used to determine whether the field has any content. Merely accessing the field seems to render future accesses impossible.

 
Old October 31st, 2003, 06:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Have you tried assigning it's value to a variable?

Code:
sMemo = rs("memo")
if sMemo <> "" then
  response.write "Show me " & sMemo
end if
 
Old October 31st, 2003, 06:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

This is a bit odd indeed, and looks a bit like other known issues with BLOB fields (http://support.microsoft.com/default...NoWebContent=1).

One thing to work around this, is to assign the value of the BLOB Memo) field to a variable and use that in your code:
Code:
Dim BodyText
BodyText = rs("memo")
If Len(BodyText) > 0
  Response.Write("Show me " & BodyText)
End If
This way the Memo field is only accessed once, while you still have full functionality.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Format : Memo scandalous Access 2 February 22nd, 2007 10:31 AM
Need help in exporting memo fields to CSV file Programming_starter C# 0 May 22nd, 2006 11:25 AM
formatting memo fields in access database fskilnik Dreamweaver (all versions) 8 February 14th, 2006 06:24 PM
Storing Data in Memo Fields! tks_muthu Classic ASP Databases 2 April 11th, 2005 02:07 AM
Memo Fields with Windows Forms in C# jim.stanley Access 0 November 15th, 2004 05:55 PM





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