Solved

Reading value from recordset removes the data

Posted on 2004-08-27
7
205 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sorting - Classic asp putting a specific text @ the top of the table 3 46
Pass through dll 2 86
Recordset containing single quotes 8 36
Html Table looping 4 13
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…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

823 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