Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2005, 10:03 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default I have records where I need to replace one letter

I have records where I need to replace one letter with another. Can I modify this highlighting code to do that?

What I need to do is to update my table of database where a column has to replace one letter with another.

WHat I have is the "insert into" statement where I duplicated the table (not shown below).

I need your advice on this.

Code:
<SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER">
Function Highlight(strText, strFind, strBefore, strAfter)
  Dim nPos
  Dim nLen
  Dim nLenAll

  nLen = Len(strFind)
  nLenAll = nLen + Len(strBefore) + Len(strAfter) + 1

  Highlight = strText

  If nLen > 0 And Len(Highlight) > 0 Then
    nPos = InStr(1, Highlight, strFind, 1)
    Do While nPos > 0
      Highlight = Left(Highlight, nPos - 1) & _
        strBefore & Mid(Highlight, nPos, nLen) & strAfter &_
         Mid(Highlight, nPos + nLen)

      nPos = InStr(nPos + nLenAll, Highlight, strFind, 1)
    Loop
  End If
End Function
</SCRIPT>
<%
'OPTION EXPLICIT
Dim strText, strFind
strFind=Keyword
strText=RS("new_text_data")
strText= Highlight(strText, strFind,"<b>", "</b>")
Response.Write strText
%>
Learning of our true origins.

I feel sorry:

http://www.infowars.com/articles/wor...eknowledge.htm

Foreknowledge of A Natural Disaster
Washington was aware that a deadly Tidal Wave was building up in the Indian Ocean
 
Old March 11th, 2005, 01:15 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You can use replace function in SQL server to to the same..

SELECT REPLACE('abcdefghicde','cde','xxx')


Om Prakash
 
Old March 11th, 2005, 02:29 AM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

what I want to work on is this:
Code:
  SQL = "SELECT * FROM new_hebrewbibletable WHERE "
  SQL = SQL & "new_text_data LIKE '%" & Keyword & "%' "
Keyword is the name of the textbox. Is there a way to add a second textbox "Keywordb" to tell what to replace with?

 
Quote:
quote:
Quote:
Keyword=A
Keywordb=)
Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm




Similar Threads
Thread Thread Starter Forum Replies Last Post
Letter replace in hangman. martoufmarty Javascript How-To 12 June 17th, 2008 12:30 AM
Generating notification letter Ruman29 Access 1 June 28th, 2006 08:17 PM
search first letter keyvanjan Classic ASP Basics 2 May 17th, 2006 01:47 AM
how can i get the drive letter (e.g. F:) of the ne arif_1947 VS.NET 2002/2003 0 October 5th, 2004 12:07 PM
Obtaining a variable from the first letter... starsol Beginning PHP 3 August 18th, 2003 01:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.