Solved

trouble displaying mssql text datatype on web page

Posted on 1998-10-10
7
236 Views
Last Modified: 2013-12-25
When I store text in a text datatype in mssql, I have trouble retrieving that data on the web.  I'm using the
following query in an asp page:

strLnk = "Select link_name, link_id, link_body, Link_url from links where link_id = " & linkID
Set RSLNK = TIADB.Execute(strLnk)

later in the page, I want to get the link_body to display
in a textarea:

<textarea rows="4" cols="52" wrap="on">
<%= RSLNK("link_body") %></textarea>

I can get other datatypes out of the same table with
this query.  but the text data types do not display.
If I run the query in the query tool, it's fine; I get
the link_body.

Can anyone tell me what's going on?

Thanks.
0
Comment
Question by:denam
  • 4
  • 3
7 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 50 total points
Comment Utility
If you have only one text data field, then it should be the last mentioned in the select statement.

But always works when you define your recordset a bit differently:

Set RS = Server.CreateObject("ADODB.Recordset")
strLnk = "Select link_name, link_id, link_body, Link_url from links where link_id = " & linkID
RS.Open strSQL, Conn, 1, 1

0
 
LVL 28

Expert Comment

by:sybe
Comment Utility
sorry the last line should be:
RS.Open strLnk, Conn, 1, 1
0
 
LVL 1

Author Comment

by:denam
Comment Utility
Thanks Sybe.  Mind commenting on the difference between these two methods
of defining a record set?  
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 28

Expert Comment

by:sybe
Comment Utility
I just know that it makes a difference for mssql. I have no idea why. There is something like a quick & dirty recordset, and a recordset that is created according to ADO convenience.
0
 
LVL 1

Author Comment

by:denam
Comment Utility
...actually this isn't working.  i get an object required error message.
0
 
LVL 28

Expert Comment

by:sybe
Comment Utility
??
what is the error message, and what is the line that it points to ?
0
 
LVL 1

Author Comment

by:denam
Comment Utility
HI Sybe, I'm not sure.  I ended up creating a separate
query for each of the text values I needed to return.  Kind of
a work around.  If I get some time, I can set up
a test and try to see what I was doing wrong.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

744 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

15 Experts available now in Live!

Get 1:1 Help Now