Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Desperate call for fp_sQry= help in database search


Message #1 by "Richi" <richiwatts@h...> on Thu, 25 Jul 2002 21:29:30
Could someone please have a read through as I am getting desperate and 
tired after trying to solve it for 3 days and nights. I have learnt a lot 
of other things through the amount of stuff i have read through but not an 
answer to this. [b]Anyway:[/b]

I have a form to search my database which I created in FP2000 (DRW). 
However, I think the [b]fp_sQry="[/b]code is completely wrong. I would be 
most grateful if someone can guide me in the right direction here.

I have 4 search entries to query the database and they are: (language 
from), (language to), (area) and (Name).

What I want them to search in the database is as follows:

[b]language from[/b] = search in database under fields 
(languagefrom1,languagefrom2,languagefrom3) for a match.

[b]language to[/b] = search in database under fields 
(languageto1,languageto2) for a match.

[b]area[/b] = search in database under fields (area1, area2 through to 
area8) for a match.

[b]name[/b] = Search under name field

The code that i have now is:

fp_sQry="SELECT * FROM Results WHERE (Translatefrom1 
LIKE '%::Translatefrom1::%' OR Translatefrom2 LIKE '%::Translatefrom2::%' 
OR Translatefrom3 LIKE '%::Translatefrom3::%' AND Translateto1 
LIKE '%::Translateto1::%' OR Translateto2 LIKE '%::Translateto2::%' AND 
Area1 LIKE '%::Area1::%' OR Area2 LIKE '%::Area2::%' OR Area3 
LIKE '%::Area3::%' OR Area4 LIKE '%::Area4::%' OR Area5 LIKE '%::Area5::%' 
OR Area6 LIKE '%::Area6::%' OR Area7 LIKE '%::Area7::%' OR Area8 
LIKE '%::Area8::%' AND Name LIKE '%::Name::%')"
fp_sDefault="Translatefrom=NULL&Translateto=NULL&Area=NULL&Name=NULL"

And the code for the form is:

<td><input TYPE="TEXT" NAME="Translatefrom" VALUE="<%=Request
("Translatefrom1")%>" size="20"></td>
<tr>
<td><input TYPE="TEXT" NAME="Translateto" VALUE="<%=Request
("Translateto1")%>" size="20"></td>
</tr>
<tr>
<td><input TYPE="TEXT" NAME="Area" VALUE="<%=Request("Area1")%>" 
size="20"></td>
</tr>
<tr>
<td><input TYPE="TEXT" NAME="Name" VALUE="<%=Request("Name")%>" 
size="20"></td>

I really hope someone understands what I am trying to do and can offer 
some help!

  Return to Index