Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Reading value from recordset removes the data

Posted on 2004-08-27
7
206 Views
Last Modified: 2006-11-17
I have two lines of code:
if isNull(rsJobs("hours")) or rsJobs("hours")="" then hours=" " else hours=rsJobs("hours")

if isNull(rsJobs("howto_apply")) or rsJobs("howto_apply")="" then howto_apply=" " else howto_apply= rsJobs("howto_apply")

I then write out the variables hours and howto_apply.  The bizarre thing is that it works fine for hours, but not for howto_apply.  As soon as I read the data for rsJobs("howto_apply"), I can no longer access that data.  Even if I later try to write out rsJobs("howto_apply") I get nothing.  The only differences I can see is that howto_apply is a memo field, where hours is a text field, and one field name has an underscore in it.  Any ideas?
0
Comment
Question by:rolfejr
7 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11915292
if isNull(rsJobs("howto_apply")) or trim(rsJobs("howto_apply"))=""  or isEmpty(rsJobs("howto_apply")) then

FtB
0
 

Author Comment

by:rolfejr
ID: 11916177
Let me put it a different way:

do while not rsJobs.eof
  hours=rsJobs("hours")
  howto_apply=rsJobs("howto_apply")
  response.write hours
  response.write "<br>"
  response.write howto_apply
  response.write "<br>-----------<br>"
  rsJobs.moveNext
loop

The above code will print out all of the hours in the recordset just fine.  However, it writes nothing for howto_apply.  If I remove the line:
    howto_apply=rsJobs("howto_apply")
and then later write it out with:
    response.write rsJobs("howto_apply")
then it writes out the data just fine.  Something about assigning data from the recordset to a variable "removes" the data from the recordset...but only for howto_apply, not for hours.
0
 

Expert Comment

by:Valadas2
ID: 11919125
Have you tried to put END IF after each IF
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 11933899
Make sure the memo field is the last field selected in your SQL.
0
 

Accepted Solution

by:
rolfejr earned 0 total points
ID: 11958924
I have answered this question.  I changed the field from a Text field to a varchar with a length of 255.  It didn't like something about the Text data type.  Once I made the change, everything was peachy.  Thank you for all your help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question