Solved

Reading value from recordset removes the data

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Classic ASP - SQL Server connection problem Part 2! 3 53
Issue with Loop 4 50
format nvarchar field as mm/dd/yyyy 4 61
Need to rewrite code for checking if a file exists 3 58
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now