ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #16  
Old October 14th, 2009, 10:33 AM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
Can anyone help me with this last issue?

Reply With Quote
  #17  
Old October 15th, 2009, 03:48 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 12,259 micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 4 Days 2 m 48 sec
Reputation Power: 2179
The function is correct, i have checked it with static values.

Can you post example data of string you have and 3 search words?

And i think that this is a case-sensitive also.
I mean if you search for "I" then it doesnt highlight "i"
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #18  
Old October 15th, 2009, 09:40 AM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
Here's an example of data in the resume_doc field.

Quote:
John Doe Vice-President of Technology. Programming skills are html, php, unix, sql, asp. Hardware - Sun server IBM mainframe, AS400.


Now I want to search the resume_doc field for records that have these three keywords in that field ...
Quote:
President
IBM
sql


The results should include the record above and other records with these three words. -President, IBM, and sql should be highlighted in the resume_doc field when the results are returned. Does this make sense? Thanks for the help! I appreciate it

Reply With Quote
  #19  
Old October 16th, 2009, 03:30 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 12,259 micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 4 Days 2 m 48 sec
Reputation Power: 2179
Hmm, this looks good!!

We'll have to debug it step-by-step.
First check whether your sql is bringing desired records from database.

Then response.write the records and the 3 search variables to make sure we getting all data.

Be advised that values from Access memo fields can be accessed just once using such code rs("resume_doc")
If you need it more than once, better save it in some variable and then use that variable.

In the end, make sure all 4 variables (memo field and 3 search values) are being passed to the function.

Reply With Quote
  #20  
Old October 16th, 2009, 04:50 PM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
the sql is fine. I also tested the sql in the Access database and it works perfectly. Now to get it working in asp is the challange. Still not sure how to get the results from the response.write to display properly on the webpage. Any ideas?

Reply With Quote
  #21  
Old October 16th, 2009, 05:15 PM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
I eliminated the highlight function just for a test
The response.write now looks liks this ..

Code:
Response.Write ("<td>" &  rs("resume_doc") & "</td>")


The page returns data but it is only using the first item entered as the criteria. The page appears to be ignoring the other 2 conditions in the sql. It should use all three criteria when doing the search. Can you explain what I'm doing wrong? I'm very new to asp and am struggling trying to get this to work. Thank you for your help and advice.

Reply With Quote
  #22  
Old October 17th, 2009, 04:24 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 12,259 micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 4 Days 2 m 48 sec
Reputation Power: 2179
Hmm, the page cannot change the query and show its own records.
Either the query is wrong is wrong or we are missing something.

Please latest relevant code.

Reply With Quote
  #23  
Old October 19th, 2009, 11:30 AM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
Here's snippets of the code...

These are my variables
Code:
strURL = Request.ServerVariables("URL") 
Dim rstSearch  ' ADO recordset
Dim strSearch  ' The text being looked for
Dim strSearch1  ' The text being looked for
Dim strSearch2  ' The text being looked for
Dim strFind1
Dim strFind2
Dim strFind3
dim strColor

strSearch = Request.QueryString("search")
strSearch = Request.QueryString("search1")
strSearch = Request.QueryString("search2")
 


Here's the highlight function

Code:
'
Function Highlight(strText, strFind1, strFind2, strFind3, strColor)

strText = cStr(strText)
strText = Replace(strText,strFind1,"<font color=" & strColor & ">" & strFind1 & "</font>")
strText = Replace(strText,strFind2,"<font color=" & strColor & ">" & strFind2 & "</font>")
strText = Replace(strText,strFind3,"<font color=" & strColor & ">" & strFind3 & "</font>")

Highlight = strText   
End Function
 



Here's the text box on the form where the user inputs the text to search
Code:
<p><B>Search and/or Update a Candidates' Record by the Resume Document field</B></p>  
<p></p>
<p><B>Enter a key word you want to search for or % in the text box below</B></p>  
<p></p>
<form action="<%= strURL %>" method="get">
<input name="search" value="<%= strSearch %>" />
<p>

<p><B>Enter a second key word you want to search for or % in the text box below</B></p>  
<p></p>
<input name="search1" value="<%= strSearch1 %>" />
<p>

<p><B>Enter a third key word you want to search for or % in the text box below</B></p>  
<p></p>
<input name="search2" value="<%= strSearch2 %>" />
<p>
<input type="submit" />
</p>
</form>
<p></p> 


Here's the sql

Code:
sql= "SELECT * " _
		& "FROM [RSA_Candidates] " _  
		& "WHERE resume_doc LIKE '%"& Replace(strSearch, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch1, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch2, "'", "''") & "%' " _
                  		& "ORDER BY lastname;"
  


Here's the response.write code with the highlight function...If you can show me how to use the highlight function here where it highlights the three key words in this statement that would be great...

Code:
Response.Write "<table border=1 cellspacing=2>"
  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Resume: " & "</B>" & "</td>")
    'Response.Write ("<td>" &  Highlight(rs("resume_doc"), StrSearch, StrSearch1, StrSearch2,"blue") & "</td>")
    Response.Write ("<td>" &  rs("resume_doc") & "</td>")
     Response.Write ("</tr>") 
    


Thank you for your help

Reply With Quote
  #24  
Old October 20th, 2009, 03:05 PM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
Unhappy

can anyone review my last post and help me out?
I'd appreciate it. Thanks

Reply With Quote
  #25  
Old October 21st, 2009, 04:33 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 12,259 micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)micky User rank is General 18th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 4 Days 2 m 48 sec
Reputation Power: 2179
I dont know whats the issue here, so i can only suggest that save the memo field in a variable first and then use it. Like
Code:
strDoc = rs("resume_doc")
Response.Write ("<td>" &  Highlight(strDoc, StrSearch, StrSearch1, StrSearch2,"blue") & "</td>")

Reply With Quote
  #26  
Old October 22nd, 2009, 09:38 PM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
Red face

I did as you suggested using the strDoc variable and now the page has an http 500 error. I'm pasting all the code below. Can you please review it and advise what it is I'm doing wrong?

Code:
  
<% @ LANGUAGE="VBScript" %>
<%

Option Explicit
Response.Buffer = True

Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adUseClient = 3
Const adCmdText = 1


 Dim conn, rs, sql
 Dim strURL     ' The URL of this page so the form will work
 ' Retreive the URL of this page from Server Variables
strURL = Request.ServerVariables("URL") 
Dim rstSearch  ' ADO recordset
Dim strSearch  ' The text being looked for
Dim strSearch1  ' The text being looked for
Dim strSearch2  ' The text being looked for
Dim strFind1
Dim strFind2
Dim strFind3
dim strColor
Dim strDoc

strSearch = Request.QueryString("search")
strSearch = Request.QueryString("search1")
strSearch = Request.QueryString("search2")
strDoc = rs("resume_doc")

 Set conn = Server.CreateObject("ADODB.Connection")
 conn.open("RSA_262093")
%>

<%
'
Function Highlight(strText, strFind1, strFind2, strFind3, strColor)

strText = cStr(strText)
strText = Replace(strText,strFind1,"<font color=" & strColor & ">" & strFind1 & "</font>")
strText = Replace(strText,strFind2,"<font color=" & strColor & ">" & strFind2 & "</font>")
strText = Replace(strText,strFind3,"<font color=" & strColor & ">" & strFind3 & "</font>")

Highlight = strText   
End Function
 


'*************************************************  ****************************
%>




<html> 
<body bgcolor="#FFFFFF">



<p><B>Search and/or Update a Candidates' Record by the Resume Document field</B></p>  
<p></p>
<p><B>Enter a key word you want to search for or % in the text box below</B></p>  
<p></p>
<form action="<%= strURL %>" method="get">
<input name="search" value="<%= strSearch %>" />
<p>



<p><B>Enter a second key word you want to search for or % in the text box below</B></p>  
<p></p>

<input name="search1" value="<%= strSearch1 %>" />
<p>



<p><B>Enter a third key word you want to search for or % in the text box below</B></p>  
<p></p>

<input name="search2" value="<%= strSearch2 %>" />
<p>

<input type="submit" />
</p>
</form>
<p></p>

 
<% 
If strSearch <> "" Then
 Set rs = Server.CreateObject("ADODB.Recordset") 

 sql= "SELECT * " _
		& "FROM [RSA_Candidates] " _  
		& "WHERE resume_doc LIKE '%"& Replace(strSearch, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch1, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch2, "'", "''") & "%' " _
                  		& "ORDER BY lastname;"
  
    
 rs.Open sql, conn, adOpenForwardOnly, adLockReadOnly, adCmdText
%> 


<%
IF not Rs.EOF then
 Do While not Rs.EOF

Response.Write "<FORM name='Update' method='post' action='UpdateT.asp'>" 

Response.Write "<table border=1 cellspacing=2>" 

 

 
   Response.Write ("<tr>") 
    Response.Write("<td colspan='1' align='center'>"&"<input type ='submit' name='submit' value='Update' >"&"</td>")
    Response.Write ("<td>" & " <input type='radio' name='ID' value=" & rs("ID") & "></td>") 
    Response.Write ("<td>" & "<B>"  & "Last Name: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("LastName")  & "</td>") 

    Response.Write ("<td>" & "<B>"  & "First Name: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("FirstName")  & "</td>") 
  
    Response.Write ("<td>" & "<B>"  & "MI: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("MI")  & "</td>") 

    Response.Write ("<td>" & "<B>"  & "Title: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("title")  & "</td>")
    
    Response.Write ("<td>" & "<B>"  & "Company: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("Company")  & "</td>")

 
    Response.Write "<table border=1 cellspacing=2>" 
   Response.Write ("<tr>") 
    Response.Write ("<td>" & "<B>"  & "Client: " & "</B>" & "</td>") 
    Response.Write ("<td> <font color='#FF0000'>" & rs("Client")  & " </font></td>")
    Response.Write ("<td rowspan=21 valign='top'>" & rs("Notes") & "</td>") 
    Response.Write ("</tr>") 


   Response.Write ("<tr>") 
    Response.Write ("<td>" & "<B>"  & "Industry: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("industry")  & "</td>")
    Response.Write ("</tr>")


    Response.Write ("<tr>") 
    Response.Write ("<td>" & "<B>"  & "Discipline: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("discipline")  & "</td>")
    Response.Write ("</tr>") 

   Response.Write ("<tr>") 
    Response.Write ("<td>" & "<B>"  & "Compensation: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("compensation")  & "</td>")
    Response.Write ("</tr>") 
  
   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Cell Phone: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("cell_phone")  & "</td>")
   Response.Write ("</tr>") 

    Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Office Phone: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("office_phone")  & "</td>")
   Response.Write ("</tr>") 

    Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Home Phone: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("home_phone")  & "</td>")
   Response.Write ("</tr>") 

   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Fax: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("fax")  & "</td>")
   Response.Write ("</tr>") 

    Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Email: " & "</B>" & "</td>")
     Response.Write ("<td><A HREF=mailto:"& rs("email") & "> "& rs("email") &" </A></td>")
   Response.Write ("</tr>") 
   

   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Address: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("address")  & "</td>")
   Response.Write ("</tr>")    


   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "City: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("City")  & "</td>")
   Response.Write ("</tr>") 

   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "State: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("state")  & "</td>")
   Response.Write ("</tr>") 

  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Zip: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("zip")  & "</td>")
   Response.Write ("</tr>") 


  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Relocation: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("Relocation")  & "</td>")
   Response.Write ("</tr>") 


   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Education: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("Education")  & "</td>")
   Response.Write ("</tr>") 


  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Affiliations: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("Affiliations")  & "</td>")
   Response.Write ("</tr>") 

  
  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Refered By: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("Refer_by")  & "</td>")
   Response.Write ("</tr>") 
  
   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Resume on File: " & "</B>" & "</td>")
    Response.Write ("<td><A HREF=http://www.rsaexecsearch.com/rsa/resumes/" & rs("Resume")  & "> "& rs("Resume") &"</A></td>")
   Response.Write ("</tr>") 

   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "References: " & "</B>" & "</td>")
    Response.Write ("<td><A HREF=http://www.rsaexecsearch.com/rsa/references/" & rs("References")  & "> "& rs("References") 

&"</A></td>")
   Response.Write ("</tr>")
  



   Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Date of First Entry: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("Date_first_entry")  & "</td>")
   Response.Write ("</tr>") 


  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Date of Last Entry: " & "</B>" & "</td>")
    Response.Write ("<td>" & rs("Date_last_entry")  & "</td>")
   Response.Write ("</tr>") 


 Response.Write "<table border=1 cellspacing=2>"
  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Resume: " & "</B>" & "</td>")
    Response.Write ("<td>" &  Highlight(strDoc, StrSearch, StrSearch1, StrSearch2,"blue") & "</td>")
     Response.Write ("</tr>") 


   Response.Write ("<tr>") 
     Response.Write ("<td BGCOLOR=#ffff00 colspan=5>&nbsp;</td>")
      
   Response.Write ("</tr>") 
      



    Response.Write ("</tr>") 
    Rs.MoveNext
Loop 
else 
   Response.Write("No records found")
end if
 
Response.Write "</table>" 
Response.Write "</table>" 
Rs.Close 
Set Rs = Nothing 
Set Conn = Nothing 
End If
%> 
</form> 
</body> 
</html> 


Thank you for your help and patience. I appreciate it

Reply With Quote
  #27  
Old October 22nd, 2009, 10:03 PM
keep_it_simple's Avatar
keep_it_simple keep_it_simple is offline
KIS
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2007
Location: USA
Posts: 1,536 keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level)keep_it_simple User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 20 h 53 m 22 sec
Reputation Power: 845
Send a message via Yahoo to keep_it_simple
you have strDoc = rs("resume_doc")
in the wrong place

remove it where you have it and put right after your do while loop - you cannot use it there because the recordset object (rs) has not been opened

Code:
Do While not Rs.EOF
 strDoc = rs("resume_doc")

Response.Write "<FORM name='Update' method='post' action='UpdateT.asp'>"

'... 


also if using internet explorer...you can view detailed error messages by:

tools>internet options>advanced>browsing>UNCHECK show friendly http error messages
__________________
Please give respect to those that helped solve an issue by clicking on the reputation icon

Reply With Quote
  #28  
Old October 23rd, 2009, 10:23 AM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
Thank you. Now the page is appearing. It looks like the results are not meeting the criteria of the 3 values that are entered by the user. I believe my sql is correct

Code:
sql= "SELECT * " _
		& "FROM [RSA_Candidates] " _  
		& "WHERE resume_doc LIKE '%"& Replace(strSearch, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch1, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch2, "'", "''") & "%' " _
                  		& "ORDER BY lastname;"


Also the highlight function isn't working at all

Code:
<%
'
Function Highlight(strText, strFind1, strFind2, strFind3, strColor)

strText = cStr(strText)
strText = Replace(strText,strFind1,"<font color=" & strColor & ">" & strFind1 & "</font>")
strText = Replace(strText,strFind2,"<font color=" & strColor & ">" & strFind2 & "</font>")
strText = Replace(strText,strFind3,"<font color=" & strColor & ">" & strFind3 & "</font>")

Highlight = strText   
End Function
 


Any idea what is wrong here? Thank you again for the help. I'm pretty frustrated at this point.

Reply With Quote
  #29  
Old October 26th, 2009, 09:41 AM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
does anything look wrong with the SQL? I need it to bring back the records that meet all 3 conditions that the user entered. Thanks for the help!

Reply With Quote
  #30  
Old October 26th, 2009, 11:42 AM
igidttam igidttam is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 26 igidttam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 23 m 27 sec
Reputation Power: 0
Search multiple keyword search in a memo field using asp

Our user wants to do a search on a memo field in an Access database using 3 different keywords. The webpage is coded in ASP.

The memo field is called resume_doc.
Here is the sql code in the asp page...


Code:
sql= "SELECT * " _
		& "FROM [RSA_Candidates] " _
		& "WHERE resume_doc LIKE '%"& Replace(strSearch, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch1, "'", "''") & "%' AND " _
                & "resume_doc LIKE '%"& Replace(strSearch2, "'", "''") & "%' " _
                  		& "ORDER BY lastname;"




The user enters the 3 keywords in three different text boxes.
Here is the code for the keyword entry......

Code:
<form action="<%= strURL %>" method="get">
<input name="search" value="<%= strSearch %>" />
<p>


<p><B>Enter a second key word you want to search for or % in the text box below</B></p>  
<p></p>

<input name="search1" value="<%= strSearch1 %>" />
<p>


<p><B>Enter a third key word you want to search for or % in the text box below</B></p>  
<p></p>

<input name="search2" value="<%= strSearch2 %>" />
<p>


<input type="submit" />
</p>
</form>
<p></p>




For the response.write statement, it appears it only captures the first keyword and ignores the other 2 keywords. Here is the response.write code ...


Code:
Response.Write "<table border=1 cellspacing=2>"
  Response.Write ("<tr>") 
   Response.Write ("<td>" & "<B>"  & "Resume: " & "</B>" & "</td>")
   Response.Write ("<td>" & rs("resume_doc") & "</td>")         
     Response.Write ("</tr>") 



Is my response.write code incorrect? I believe my sql is correct. Can someone help me out here please? Thanks!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Multiple keyword search on one database field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek