Ask a Question related to ASP Database, Design and Development.
-
suksawat #1
'Text' data type returned differently between ASP & Query Analyzer
I have the SQL 2000 server with a database table having one 'text' data type column. This column stores the general text message (normally body of the email message) which the thrid party application inserts in
I wanted to query this column and display on the html page using ASP
The ASP code returned the data in the column in the continued text which has no linebreaks at all, and the result format is not readble. I copied the text displayed on the returned page onto the notepad then opened with the hex editor to see the text in raw format, and found none of char13, char 10 nor any char which may identify the linebreak. It seemed to me there are no linebreaks or any identifiers to the linebreaks for the data returned from the ASP comparing to the original text
I then tried query the same column from the Query analyzer. I copied the result returned from the query analyzer into the notepad. I then opened it with the hex editor to see what it contains in raw format,and I found there were char code 20 (space char) instead. I noticed that 2 spaces char code indentify the line break in which they substitue one line break when comparing to the original text
my questions
- Why the result returned in ASP has no linebreak indentifiers like the result returned from the query analyzer ( 2 spaces char)
- What would be the way to query the data from the 'text' data type column and display correctly as the original text format
I used the common basic asp code as belo
<%@ Language="VBScript"%><
strSQL = "Select Body from main
set conn = Createobject("ADODB.Connection"
conn.open "Provider=SQLOLEDB;Data Source=Pluto;Initial Catalog=Message;Integrated Security=SSPI
set rs = conn.execute (strSQL
rs.MoveFirs
Do While Not rs.Eo
%><tr><td>Body= </td><td><%=rs("Body")%></td></tr><
rs.movenex
Loo
rs.clos
conn.clos
Many thanks in advance
suksawat Guest
-
How to set the value of a variable to some data returned from a query
Hi everybody, After I make a query and get results back, is there an easy way to do something like: <cfset some_var = "a value from the xth... -
sql statement works in query analyzer but not in asp/ado?
I am new to asp/ado (well and sql server)... this has been driving me mad for hours now. I have created an SQL statment using access query design. I... -
Generate Table script from query analyzer...
You can use SQL-DMO to do that but not straight tsql. -- Andrew J. Kelly SQL Server MVP "Robert Taylor" <robertt@rtnetworks.com> wrote... -
Data type query
Hi I have to specify in a table certain values for: Minutes duration spent on phone-eventduration, the eventdate-which date, and event time- exact... -
BCP query out executed by xp_cmdshell works fine from query analyzer but fails from VB Component
Hi all, I have a stored procedure which returns a vast number of record and i have to write the output into a csv file. I'm using BCP utility to... -
Aaron [SQL Server MVP] #2
Re: 'Text' data type returned differently between ASP & Query Analyzer
> The ASP code returned the data in the column in the continued text which
Yes, because plain text and HTML are not identical!> has no linebreaks at all, and the result format is not readble.
Imagine if you created an HTML page and every single line break was
interpreted that way? We'd either have very ugly web pages or HTML code
that was impossible to maintain.
You need to replace plain text carriage returns with HTML tags that
represent and display carriage returns.
[url]http://www.aspfaq.com/2188[/url]
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
(Reverse e-mail to reply.)
Aaron [SQL Server MVP] Guest



Reply With Quote

