|
| |
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
keyword search - 4/4/2005 22:47:04
Hi all, I am putting together a page that will allow employers to view profiles of potential candidates, searchable by position title and then use check boxes to enquire further. The page works well with the exception of a limited search function. The trial data includes position titles of "Plant or General Manager" and "Operations Manager" When I enter manager both profiles return. When I enter Operations Manager the Operations Manager profile returns When I enter Plant Manager I receive no records returned I am using the LIKE function. How do I set it up so two or more key words entered will bring back results even if it is not an exact match. (eg. When plant manager is entered the Plant or General Manager profile returns). Trail page can be viewed at meridiansearch trial page Thanks in advance, Larry
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/4/2005 23:04:05
fp_sQry="SELECT * FROM Results WHERE ([position] LIKE '%::position::%')" fp_sDefault="position=" Larry
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/5/2005 9:08:01
Thanks Spooky, Worked like a charm in providing the search results. However when the page is entered for the first time I receive the error message Database Results Error: mismatched parameter delimiters This also appears if you submit without entering keywords. Larry
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/5/2005 16:10:20
Sorry Spooky, Getting the same error when using this code Position = replace(request.form("position")," ","%") If Position &""="" then Position = "%" fp_sQry="SELECT * FROM Results WHERE ([position] LIKE '%"&position&"%')" fp_sDefault="position=" Do you mean replace the fp_sDefault="position=" with If Position &""="" then Position = "%" I have tried this as well but same result Thanks
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/5/2005 16:47:51
This is the new error I'm getting SELECT * FROM Results WHERE ([position] LIKE '%%%')Database Results Error: mismatched parameter delimiters From this code Position = replace(request.form("position")," ","%") If Position &""="" then Position = "%" fp_sQry="SELECT * FROM Results WHERE ([position] LIKE '%"&position&"%')" response.write fp_sQry fp_sDefault="position="
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 10:57:11
No Luck Replaced the includes file with the old and have used the following code: <!--#include file="../_fpclass/fpdblib.inc"--> <% if 0 then %> <SCRIPT Language="JavaScript"> document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>"); </SCRIPT> <% end if %> <% Position = replace(replace(request.form("position"),"'","''")," ","%") If Position &""="" then Position = "%" fp_sQry="SELECT * FROM Results WHERE ([position] LIKE '%"&position&"%')" fp_sNoRecords="<tr><td colspan=3 align=left width=""100%"">No records match your search. Please try again</td></tr>" fp_sDataConn="Trialdat" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_sColTypes="&ID=3&name=202&city=202&province=202&email=202&phone=202&position=202&desiredposition=202&description=203&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&" fp_iDisplayCols=3 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID <!--#include file="../_fpclass/fpdbrgn1.inc"--> Results Database Results Error: mismatched parameter delimiters FYI - I did a google and yahoo search using the above error and it came back with many, many sites that have the same problem but have not fixed - YIKES!
|
|
|
|
BeTheBall
Posts: 6381 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: keyword search - 4/6/2005 12:43:26
What if you replace: Position = replace(replace(request.form("position"),"'","''")," ","%") If Position &""="" then Position = "%" fp_sQry="SELECT * FROM Results WHERE ([position] LIKE '%"&position&"%')" with simply: Position = replace(request.form("position"),"'","''") fp_sQry="SELECT * FROM Results WHERE ([position] LIKE '%"&position&"%')"
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 13:08:52
Thanks Duane, Still getting the same message. I have been looking at a thread that you had helped out with on an apostraphe issue whereas the same message was being displayed. I was hoping it might hold some answers. The thread is Apostraphe Issues Thanks, Larry
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 16:19:35
Sorry Spooky, Still the same. Grasping at straws but would the name position be causing any of this? I do know that it is a reserved word.
|
|
|
|
BeTheBall
Posts: 6381 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: keyword search - 4/6/2005 17:08:09
This is perhaps the most creative thing I have ever tried, but in theory it works. Try this: Assuming this is the last code you tried: Position = replace(replace(request.form("position"),"'","''")," ","%") If Position &""="" then Position = "%" sQry = "SELECT * FROM Results WHERE ([position] LIKE '%"&position&"%')" fp_sQry = sQry Replace the above with: <% varString = trim(replace(request.form("position"), "'","''")) arrString = Split(varString, " ") mySQL = "SELECT * FROM Results WHERE [position] LIKE '%"&arrString(0)&"%' " If Ubound(arrString)> 0 Then For i = 1 to Ubound(arrString) mySQL = mySQL & " AND fldname LIKE '%"&arrString(i)&"%' " Next End If fp_sQry = mySQL
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 17:10:38
fp_sQry="SELECT * FROM Results WHERE ([position] LIKE '%Plant%Manager%')" Yes the above works with no error.
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 17:24:01
Hi Duane, When the field is blank this returns error as: Microsoft VBScript runtime error '800a0009' Subscript out of range: '[number: 0]' /traditional/trial.asp, line 154 When you fill in the search field with manager and submit, all manager positions return ok When you fill in the search field with plant manager and submit the following error returns: Database Results Error Description: No value given for one or more required parameters. Number: -2147217904 (0x80040E10) Source: Microsoft JET Database Engine
|
|
|
|
BeTheBall
Posts: 6381 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: keyword search - 4/6/2005 17:30:59
Sorry forgot to change fldname to [position] in one instance. I also have added an If/Then to address an empty form field. See where this one gets you: <% If trim(replace(request.form("position")&"" <> "" Then varString = trim(replace(request.form("position"), "'","''")) arrString = Split(varString, " ") mySQL = "SELECT * FROM Results WHERE [position] LIKE '%"&arrString(0)&"%' " If Ubound(arrString)> 0 Then For i = 1 to Ubound(arrString) mySQL = mySQL & " AND [position] LIKE '%"&arrString(i)&"%' " Next End If Else mySQL = "SELECT * FROM Results" fp_sQry = mySQL
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 17:49:53
Error now reads: Microsoft VBScript compilation error '800a03ee' Expected ')' /traditional/trial.asp, line 152 If trim(replace(request.form("position")&"" <> "" -------------------------------------------------^
|
|
|
|
BeTheBall
Posts: 6381 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: keyword search - 4/6/2005 18:12:26
Change: If trim(replace(request.form("position")&"" <> "" to If trim(replace(request.form("position"))&"" <> ""
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 18:37:37
Same error returns: Microsoft VBScript compilation error '800a03ee' Expected ')' /traditional/trial.asp, line 152 If trim(replace(request.form("position"))&"" <> "" --------------------------------------------------^ I place another bracket and received this error: Microsoft VBScript compilation error '800a03f9' Expected 'Then' /traditional/trial.asp, line 152 If trim(replace(request.form("position")))&"" <> "" ---------------------------------------------------^
|
|
|
|
BeTheBall
Posts: 6381 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: keyword search - 4/6/2005 18:43:18
Sorry, I am cutting and pasting from a test page: If trim(request.form("position")&"" <> "" Then
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
meridian
Posts: 78 Joined: 11/26/2003 Status: offline
|
RE: keyword search - 4/6/2005 20:14:09
With the code: <% end if %> <% If trim(request.form("position"))&"" <> "" Then varString = trim(replace(request.form("position"), "'","''")) arrString = Split(varString, " ") mySQL = "SELECT * FROM Results WHERE [position] LIKE '%"&arrString(0)&"%' " If Ubound(arrString)> 0 Then For i = 1 to Ubound(arrString) mySQL = mySQL & " AND [position] LIKE '%"&arrString(i)&"%' " Next End If Else mySQL = "SELECT * FROM Results" fp_sQry = mySQL fp_sNoRecords="<tr><td colspan=3 align=left width=""100%"">No records match your search. Please try again</td></tr>" fp_sDataConn="Trialdat" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_sColTypes="&ID=3&name=202&city=202&province=202&email=202&phone=202&position=202&desiredposition=202&description=203&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&" fp_iDisplayCols=3 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> Now displays error: Microsoft VBScript compilation error '800a03f6' Expected 'End' E:\ACCOUNTS\MERIDIAN\TRADITIONAL\../_fpclass/fpdbrgn2.inc, line 62
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|