Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Front page ASP search page Issue

Status
Not open for further replies.

defosset

Programmer
Apr 1, 2003
48
0
0
US
i generated my ASP pages by front page, it is set to search my access database, the only problem is that when i search using my ASP page is that it only searches for specific information versus partial information.

example: it will return results when i type in "john tesh"
but when i type in just "tesh" it will return nothing. i need it to search on partial data not just specific or complete information can you help me with a resoution to this issue if you need a copy of one of my pages to look at the code let me know

thanks
Nick
 
you need to write your SQL queries to use wildcards (%)

in your example ... WHERE fieldname LIKE '%tesh' ...

W3 schools basic SQL Tutorial



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
u can say:

rs.open "select * from TableName where name like'%"&name&"%'
 
To the best of my knowledge:

%'tesh' will only look for letters before tesh

'tesh'% will only look for letters after tesh

%'tesh'% will look for letters before and after tesh.

Hope this helps ya

Rob
Just my $.02.
 
Here is a copy of my SQL where in the statment would you make this change and would this work with a front page generated sql statement

<%
fp_sQry="SELECT * FROM ""Correct Output"" WHERE (Album_Title = '::Album_Title::')"
fp_sDefault="Album_Title="
fp_sNoRecords="<tr><td colspan=8 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Praisedb"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=8
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
 
Having never used FP generated code (and never likely to). I would think that changing the SQL string to.
changes in red
Code:
fp_sQry="SELECT * FROM ""Correct Output"" WHERE (Album_Title [red]LIKE  '%[/red]::Album_Title::[red]%[/red]')"



Chris.

Indifference will be the downfall of mankind, but who cares?
[URL unfurl="true"]www.candsdesign.co.uk[/URL] A website that proves the cobblers kids adage.
[URL unfurl="true"]www.cram-system.com[/URL] Nightclub counting systems

So long, and thanks for all the fish.
 
I finally got around to changing my code and I changed the
line to read

fp_sQry="SELECT * FROM ""Correct Output"" WHERE (Album_Title LIKE '%::Album_Title::%')"

but when I pull the page it pulls every recorded from the database and when I do a search on it it still needs specific information other wise it will not return a record
it needs it to be able to do a variable search not a specific search, so what and where in my sql do i need to make the change to make this happen

nick
 
response.write out the value of fp_sQry It could show what is wrong. you can also copy and paste it here to give more info to work on.

I don't use Front Page so have no idea how it sets queries but I would be tempted to write the query manually rather than let FP generate the code.




Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
here you go:

<%
fp_sQry="SELECT * FROM ""Correct Output"" WHERE (Artist = '::Artist::')"
fp_sDefault="Artist="
fp_sNoRecords="<tr><td colspan=8 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Praisedb"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=8
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
 
I'm with the rest of these guys (and gals if any) I have never used FP so I wouldn't know how it does its queries either. How is the criteria being passed into the query?? Do you enter it into an input box and hit a submit button?? That being said, have you tried to rewrite your query like so
Code:
fp_sQry = "SELECT * FROM [Correct Output] WHERE Artist LIKE '%" & Request.Form("SomeField") & "%'"
 
enter info into a text box and hit submit
when i put that string in that you gave me it returns the following "Database Results Error: mismatched parameter delimiters" this occurs before i even enter anything into the text box

nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top