|
 |
asp_databases thread: Parsing Recordset Value
Message #1 by "Nirav Pradhan" <niravpradhan@y...> on Sun, 2 Feb 2003 07:35:39
|
|
Hi!
I was hoping somebody might have a solution to this:
I am trying to parse the value retured by recordset object to find a
newline character. My sample code look as follows:
For i=1 to Len(rs("summary"))
if Mid(rs("summary"), i,1)=? then
do this
exit for
end if
Next
? should be a newline character. I tried with vbCrlf, <br> and even ascii
character for newline, but could not make it work. I am basically trying
to grab only one paragraph from the "summary" column in the SQL database.
Can anyone suggest how can I achieve this? Appreciate any help.
Message #2 by "Kim Iwan Hansen" <kimiwan@k...> on Sun, 2 Feb 2003 14:05:34 +0100
|
|
arrSummary = split(rs("summary"), vbCrLf)
Response.Write(arrSummary(0))
-Kim
-----Original Message-----
From: Nirav Pradhan [mailto:niravpradhan@y...]
Sent: 2. februar 2003 07:36
To: ASP Databases
Subject: [asp_databases] Parsing Recordset Value
Hi!
I was hoping somebody might have a solution to this:
I am trying to parse the value retured by recordset object to find a
newline character. My sample code look as follows:
For i=1 to Len(rs("summary"))
if Mid(rs("summary"), i,1)=? then
do this
exit for
end if
Next
? should be a newline character. I tried with vbCrlf, <br> and even ascii
character for newline, but could not make it work. I am basically trying
to grab only one paragraph from the "summary" column in the SQL database.
Can anyone suggest how can I achieve this? Appreciate any help.
Message #3 by "Ken Schaefer" <ken@a...> on Mon, 3 Feb 2003 14:59:23 +1100
|
|
How are you storing the carriage return in the database?
What about using SQL so that instead of returning the *entire* article, you
just return the first paragraph - will probably boost performance since you
reduce the amount of data being marshalled.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Nirav Pradhan" <niravpradhan@y...>
Subject: [asp_databases] Parsing Recordset Value
: I was hoping somebody might have a solution to this:
: I am trying to parse the value retured by recordset object to find a
: newline character. My sample code look as follows:
:
: For i=1 to Len(rs("summary"))
: if Mid(rs("summary"), i,1)=? then
: do this
: exit for
: end if
: Next
:
: ? should be a newline character. I tried with vbCrlf, <br> and even ascii
: character for newline, but could not make it work. I am basically trying
: to grab only one paragraph from the "summary" column in the SQL database.
: Can anyone suggest how can I achieve this? Appreciate any help.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |