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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL data displays on page but NOT in a form field ?

Status
Not open for further replies.

statik

Programmer
Feb 13, 2004
3
GB
Using MS SQL 2000. I amended a field from nchar to ntext via enterprise manager and now the information will not display in a form field but does when writing directly to the page.

e.g.

This works
<% = rs(&quot;desc&quot;) %>


This shoots out blanks
<input name=&quot;desc&quot; type=&quot;text&quot; value=&quot;<%=rs(&quot;desc&quot;)%>&quot;>


So I created a new field called [desc2] and this worked ... but the next day the same thing is happening !

Any ideas people, 'cause I am stuck here big time ?
 
&quot;will not display in a form field but does when writing directly to the page&quot;

Is your form field large enough for the data?

-SQLBill
 
My mistake ! The actual code is this -

<%
' this works and displays text on the page
response.Write rs(&quot;f_description2&quot;)
%>


<TEXTAREA rows=7 cols=40 ID=&quot;idTextarea&quot; NAME=&quot;idTextarea&quot; style=&quot;display:none&quot;>
<%
' this places nothing into the outputted HTML
response.Write rs(&quot;f_description2&quot;)
%>
</TEXTAREA>



Any ideas ?
 
Before you ask ...

The <textarea> tags are used in conjuction with an ActiveX CMS editor that pulls the field data across using javascripting. The result is that the <textarea> is not actually shown on the page but a nice MS Word style editor is. The source code of the output would normally also contain the data blob. If I change the db field to another one it works.

I only have the problem with the db field that I need to display in the editor !
 
I suggest refering to the BOL, use the Index tab and enter Text Data Type. Double click on the Text datatype entry and select the option for Retrieving ntext, text, or image datatypes.

That might explain your problem.

-SQLBill

BOL = Books OnLine = Microsoft SQL Server's Help
Installed as part of the Client Tools
Found at Start>Programs>Microsoft SQL Server>Books OnLine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top