Wrox Programmer Forums
|
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 February 24th, 2006, 06:54 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Q about search DB...

Hi all...
I did a search form...
when user write in the form: Moscow
The form give him all the results with the word Moscow

But when he write Moscow London the result is 0 entries...

BUT in the table we can find Moscow to London

And the search ignores this. cuz he search's full frase...

What should i do th show the user Moscow to London if he search Moscow london...

Here's the code:

Code:

    strSQL = "SELECT marsh, polnyi, id " _
        & "FROM Question " _
        & "WHERE marsh LIKE '%" & Replace(strpoisk, "'", "''") & "%' " _
        & "OR polnyi LIKE '%" & Replace(strpoisk, "'", "''") & "%' " _
        & "ORDER BY id;"

Sorry for my English... and thank for your help!


 
Old February 27th, 2006, 07:49 PM
Authorized User
 
Join Date: Feb 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

... my english is terrible !

strSQL = "SELECT marsh, polnyi, id " _
        & "FROM Question WHERE (marsh LIKE "

Dim Pos
Pos = 1
While Pos > 0
Pos = InStr(1, strpoisk," ")
If Pos = 0 Then


strSQL = strSQL & "'%" & strpoisk & "%')"

Else

strSQL = strSQL & "'%" & Mid(strpoisk,1,Pos) & "%' OR polnyi LIKE "
strpoisk = Mid(strpoisk,Pos+1,len(strpoisk))
End If
Wend


strSQL = strSQL & "ORDER BY id;"

response.write strSQL

try this code !

Steweb





Visit my web site !
www.steweb.net





Similar Threads
Thread Thread Starter Forum Replies Last Post
Search button doesn't search Access DB cbones Visual Studio 2008 1 October 27th, 2008 07:36 PM
Speeding up DB search, how? rtr1900 Classic ASP Databases 3 December 18th, 2006 09:04 AM
Error When Trying to Search in Access DB Using ASP mvollmer Classic ASP Databases 3 October 10th, 2003 10:52 AM
How to search entire DB[?] Blaise SQL Server 2000 7 June 11th, 2003 09:41 AM





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