When are blogs deleted from the list of the blogs I've read?
RE: Please Help Advanse Search, two parts are working, the 3rd to conn
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > RE: Please Help Advanse Search, two parts are working, the 3rd to conn 21 August 2008 22:45:09

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

RE: Please Help Advanse Search, two parts are working, the 3rd to conn

Old Pedant 21 August 2008 22:45:09
 
First, change your options for the salary to this:

<select name="Salarycom" size="1">
<option selected value="">All</optio­n>
<option value="BETWEEN 0 AND 10000">10000</optio­n>
<option value="BETWEEN 10001 AND 20000">20000</optio­n>
<option value="BETWEEN 20001 AND 30000">30000</optio­n>
<option value="BETWEEN 30001 AND 40000">30000</optio­n>
<option value="BETWEEN 40001 AND 50000">50000</optio­n>
<option value="BETWEEN 50001 AND 60000">60000</optio­n>
<option value="BETWEEN 60001 AND 70000">70000</optio­n>
<option value="BETWEEN 70001 AND 80000">80000</optio­n>
<option value="BETWEEN 80001 AND 90000">90000</optio­n>
<option value="> 100000 or Abv">100000 or Abv</option>
</select>



<%@ LANGUAGE="VBSCRIPT"­ %>
<html>
<head>
<title>Search Engine Results!</title>
</head>

<body>
<%

Dim SQL

Set aspdbweb = Server.CreateObject­("ADODB.Connection")­
aspdbweb = "Provider=Microsoft­.Jet.OLEDB.4.0; " _
& Data Source=" & Server.MapPath("emp­loyees.mdb") & ";"

' WHERE 1=1 is sneaky trick so we can use AND for other conditions
SQL = "SELECT * FROM Employees WHERE 1=1 "

' the REPLACE calls are to protect against SQL injection
whatToSearch = Replace( Trim( Request("ASPDBCatSe­arch") ), "'", "''" )
keyword = Replace( Trim( Request("Keyword") ), "'", "''" )

If whatToSearch <> "All" Then
SQL = SQL & " AND " & whatToSearch & " LIKE '%" & keyword & "%' "
End If

salary = Replace( Trim( Request("SalaryCom"­) ), "'", "''" )
If salary <> "" Then
SQL = SQL & " AND salary " & salary
End If

SQL = SQL & " ORDER BY LastName, FirstName " ' or whatever order you want

' don't use a static cursor when you don't need it...simpler & faster:
Set rsglobal = aspdbweb.Execute( SQL )
If rsglobal.EOF Then
%>
<h2 align="center">We did not find a match!</h2>
<%
Else
%>
<h2>Here are the results of your search:</h2>

... rest same ...

*******************­**

*NEVER* bother checking BOF. Pointless.

You can change the VALUE='s for salary to match what you mean if I didn't
guess right.

Add comment
Bob Barrows 21 August 2008 22:45:09 permanent link ]
 Old Pedant wrote:
*******************­
*NEVER* bother checking BOF. Pointless.

... unless navigation in the recordset has occurred, or records have
been deleted from it. :-)­

If you had added " ... immediately after opening the recordset." I would
have had no comment.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > RE: Please Help Advanse Search, two parts are working, the 3rd to conn 21 August 2008 22:45:09

see also:
form-encoding
Lenya 1.2 Usecases/Tasks
publication templating in 1.4
пройди тесты:
see also:
How to convert DVD Video to iPhone 3G
How to convert DVD movie, video…
How to Enjoy…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .