Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 24th, 2006, 06:54 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
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!


Reply With Quote
  #2 (permalink)  
Old February 27th, 2006, 07:49 PM
Authorized User
 
Join Date: Feb 2006
Location: Verona, Italy, Italy.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:20 AM.


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