Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable losing its value

Status
Not open for further replies.

spacehawk

Programmer
May 17, 2000
30
US
I have a table with a column named comments.<br><br>I select a record and use RS(&quot;comments&quot;) to get the value of comments in that record.<br><br>The line<br>Response.Write(RS(&quot;comments&quot;)) returns the value in the table.<br><br>But if it put the line:<br>comments=RS(&quot;comments&quot;) before the above mentioned line, RS(&quot;comments&quot;) becomes blank.<br><br>The table has several columns and this does not happen with any other items in the table.&nbsp;&nbsp;<br><br>Any ideas why?
 
Dear spacehawk,<br><br>&gt; RS(&quot;comments&quot;) becomes blank.<br><br>What does that mean? The data is gone from the table? If you call RS(&quot;comments&quot;) again you get nothing?<br><br>Maybe I'm just having a bad forum day.<br><br>-pete<br><br>
 
Dear spacehawk,<br><br>Can you please explain the problem again?<br><br>Anand<br>&nbsp;<br><br>&nbsp;<br>
 
palbano,<br><br>You were right in your first assumption.&nbsp;&nbsp;The next time I use RS(&quot;comments&quot;) it returns nothing.&nbsp;&nbsp;I got around the problem by using<br><br>TempData=RS(&quot;comments&quot;) and then using TempData everywhere that I had used RS(&quot;comments&quot;), but this solution makes me uncomfortable since I did not have to do that with any of the other items in my table.<br><br>Thanks for any help you can give me to understand what is happening.
 
spacehawk,<br><br>What language is this script in?<br><br>If it is javascript I would like to see you do this:<br><br>var stemp = new String(RS(&quot;comments&quot;));<br>var stemp2 = new String(RS(&quot;comments&quot;));<br><br>then<br>&lt;table border=1&gt;&lt;tr&gt;&lt;td&gt;stemp&lt;/td&gt;&lt;td&gt;&lt;%=stemp%&gt;&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;stemp2&lt;/td&gt;&lt;td&gt;&lt;%=stemp2%&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;<br><br>The reason is this, when you code this:<br><br>var temp = RS(&quot;comments&quot;);<br><br>temp is now an ADODB.Field object not a string containing the value of the field. <br><br>None of this explains the behavior you are describing though, I'm actually at a loss to understand your problem.<br><br>-pete
 
If you recordeset is fetching data from database table then it has to contain data.<br><br>&lt;%= rs(&quot;comments&quot;) %&gt;<br><br>Please makesure that rs(&quot;comments&quot;) is having value.<br><br>Anand<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top