View Single Post
  #6 (permalink)  
Old June 17th, 2005, 01:42 PM
phungleon phungleon is offline
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vijay,
I have a good news and a bad. Good news is, I was able to fix and ran the codes without any error messages. The bad news is, it seems like it is NOT querying only the items that I have checked. In other word, the query picks up everything. Below are my codes. Following that are the outputs from RESPONSE.WRITE. (NOTICE there is nothing coming out of the "response.write strList")

<% mySQL="SELECT ApplicantID FROM internship_form where isArchive=0"

strList=Request.Form("fields_of_interest")
ArrChecked = split(strList)

For i=lbound(ArrChecked) to ubound(ArrChecked)
    mySQL = mySQL & CHARINDEX(ArrChecked(i), fields_of_interest) > 0
    If i < ubound(ArrChecked) then mySQL = mySQL & " AND "
Next

Response.write mySQL
Response.write strList

set rstemp=conntemp.execute(mySQL)
do while not rstemp.eof
'This is to write out the searched results
%>


  <tr>
    <td><a href="<%=my_link%>"><%=rstemp("applicantID")%></a></td>
  </tr>

<%

rstemp.movenext
loop
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
End if
%>

HERE ARE THE SQL CODES AND RETURNED RECORDS. ITEMS IN BLUE ARE RETURNED RECORDS. NOTICE THE 'STRLIST' IS NOT THERE.
SELECT ApplicantID, firstname, lastname, submitdate, email, fields_of_interest, bilingual_skills FROM internship_form where isArchive=0
asdfasdfs30312 PhungL103246 PhungL103247 PhungL103248 PhungL103709 PhungL105905 SandersS41318 testT15900 testT20242 testT21626

Any idea why? Could it be I took off the [], and it is not recognizing the feid's name?

Thank you.

Leon


Reply With Quote