Ask a Question related to ASP Database, Design and Development.
-
Chris #1
Problem with VB replace function for CRLF...I think
I'm not sure if this is the best place for this post, sorry if it is
not...
Here is what I am doing:
I have created a small kbase (SQL db) using VB and ASP. My record set
is a SQL statement that queries the db (I am selecting 4 fields). I
then write the rs to a table. I was able to figure out how to add the
carriage returns and line feeds that are lost in html, however, for
some reason 2 of the 4 fields are always written twice.
For example, if my query result is A B C D, in other words, rs = A B C
D, for lack of a better way, it is written in the table like below
(table not shown):
AA BB C D
Obviously, it should be written as: A B C D
I can't figure this out. For the record, there can never be a CRLF in
the first two fields of the record set.
Here is my code:
<% Do while (Not oRs.eof) %>
<tr>
<% For Index=0 to (oRs.fields.count-1) %>
<TD VAlign=top>
<% = replace(oRs(Index),chr(13) & chr(10), "<br>")%>
<% = oRs(Index)%>
</TD>
<% Next %>
</tr>
<% oRs.MoveNext
Loop
%>
Since I know that I am selecting 4 fields, I can remove the for-loop
and manually write the output. Of course, if I do it this way and I
do not use the replace function at index 0 & 1 it works. I would like
to get this figured out so I can use the replace function in other
areas (where I am currently having the same problem).
Any ideas/thoughts/comments would be appreciated!
thanks,
Chris
Chris Guest
-
Replace function
Please help, I want to replace a string within field in a table with a nother string. I am using the replace function but I am doing something... -
Trouble using Replace() function in CFN file
I don't do much scripting in coldfusion besides some of the very basics for trasfering info from the database, so I'm not sure how to write this....... -
Search & Replace Function?
I have some textfield that users will enter data into on my web site and then I'll use php and write it to mysql - for security purposes, is there... -
Using Replace function to remove two different characters
I'm using replace function to strip 0s from a particular string: <%=replace(rs1("racelength"),"0","''"%> but I need to also strip empty spaces... -
Text Replace function
Hi - I'm using the replace function to hilite search words in text which is returned. However, as the text which is being searched also includes... -
Roland Hall #2
Re: Problem with VB replace function for CRLF...I think
"Chris" wrote:
: <% = replace(oRs(Index),chr(13) & chr(10), "<br>")%>
: <% = oRs(Index)%>
Why do you need both of these lines? Except for the replace function,
they're the same. Do you have data for all fields in all rows?
--
Roland
This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
[url]http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0[/url]
-Technet Script Center-
[url]http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp[/url]
-MSDN Library-
[url]http://msdn.microsoft.com/library/default.asp[/url]
Roland Hall Guest
-
Chris #3
Re: Problem with VB replace function for CRLF...I think
Awesome...thanks for the help.
"Roland Hall" <nobody@nowhere> wrote in message news:<uv9S7sd1DHA.1740@TK2MSFTNGP12.phx.gbl>...> "Chris" wrote:
> : <% = replace(oRs(Index),chr(13) & chr(10), "<br>")%>
> : <% = oRs(Index)%>
>
> Why do you need both of these lines? Except for the replace function,
> they're the same. Do you have data for all fields in all rows?
>
> --
> Roland
>
> This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose.
> -Technet Knowledge Base-
> [url]http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0[/url]
> -Technet Script Center-
> [url]http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp[/url]
> -MSDN Library-
> [url]http://msdn.microsoft.com/library/default.asp[/url]Chris Guest
-
Roland Hall #4
Re: Problem with VB replace function for CRLF...I think
"Chris" wrote:
: Awesome...thanks for the help.
You're welcome. (O:=
Roland
Roland Hall Guest



Reply With Quote

