problem with queries

Results 1 to 2 of 2

Thread: problem with queries

  1. #1
    Join Date
    Dec 1969

    Default problem with queries

    i have a page that&#039;s supposed to search a person by 3 categories;<BR>major(education), country and position applied. these are shown by list boxes. when i try to search y one category, e.g. major, the correct data shows up. but when i try 2 categories, like having a position applied as programmer and from philippines country, it shows up incorrect results.<BR><BR>here is my code:<BR>Set allRS = Server.CreateObject("ADODB.Recordset")<BR> sl = "SELECT * FROM tablename Where Major like &#039;%"&major&"%&#039;"<BR> allRS.Open sl, oConn <BR> <BR> if major &#060;&#062; "" then<BR> sl = sl & " and Major = &#039;"&major&"&#039; "<BR> end if<BR> if title &#060;&#062; "" then<BR> sl = sl & " and title = &#039;"&title&"&#039; "<BR> end if<BR> if Country &#060;&#062; "" then<BR> sl = sl & " and left(jobskrcode,2) = &#039;"&left(Country,2)&"&#039; "<BR> end if<BR><BR>im wondering why...

  2. #2
    natarajan Guest

    Default RE: problem with queries

    allRS.Open sl, oConn <BR>must be the last line of ur code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts