close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

search and existing sql WHERE clause

Thread began 2/18/2011 7:29 am by mark336119 | Last modified 2/18/2011 11:46 am by mark336119 | 2678 views | 11 replies

mark336119

again, trying to exclude certain pages from showing in the search results.

searching works fine, but cannot exclude anything. Tried in the sql statement, and with DA filters. thanks.


<%' PAGES SEARCH *********************************************%>

<%
dim WADbSearch3_DefaultWhere
WADbSearch3_DefaultWhere = ""
if (cStr(Request.Form("WADbSearch1")) <> "") then
dim WADbSearch3_whereClause, WADbSearch3_dateSeparator, WADbSearch3_wildCard
WADbSearch3_wildCard = "%"
WADbSearch3_dateSeparator = "'"


if ("ACCESS" = "ACCESS") then
WADbSearch3_dateSeparator="#"
end if
if ("ACCESS" = "ORACLE") then
WADbSearch3_dateSeparator="TO_DATE('"
end if
if ("ACCESS" = "MYSQL") then
WADbSearch3_dateSeparator="MYSQL"""
end if

'keyword array declarations
Dim WADbSearch3_KeyArr0, WADbSearch3_KeyArr1, WADbSearch3_KeyArr2, WADbSearch3_KeyArr3
WADbSearch3_KeyArr0 = Array("pagecategory")
WADbSearch3_KeyArr1 = Array("pagesection")
WADbSearch3_KeyArr2 = Array("cont_cnt")
WADbSearch3_KeyArr3 = Array("subsection")


' added by mark, remove spaces which disable searchability
Dim searchphrase_pages
searchphrase_pages = RTRIM(cStr(Request.Form("search")))

'comparison list additions
WADbSearch3_whereClause=BuildKeyword(WADbSearch3_KeyArr0,"" & searchphrase_pages & "","OR","Includes",",%20","%20","%22","%22",0,WADbSearch3_wildCard,WADbSearch3_dateSeparator,WADbSearch3_whereClause)
WADbSearch3_whereClause=BuildKeyword(WADbSearch3_KeyArr1,"" & searchphrase_pages & "","OR","Includes",",%20","%20","%22","%22",0,WADbSearch3_wildCard,WADbSearch3_dateSeparator,WADbSearch3_whereClause)
WADbSearch3_whereClause=BuildKeyword(WADbSearch3_KeyArr2,"" & searchphrase_pages & "","OR","Includes",",%20","%20","%22","%22",0,WADbSearch3_wildCard,WADbSearch3_dateSeparator,WADbSearch3_whereClause)
WADbSearch3_whereClause=BuildKeyword(WADbSearch3_KeyArr3,"" & searchphrase_pages & "","OR","Includes",",%20","%20","%22","%22",0,WADbSearch3_wildCard,WADbSearch3_dateSeparator,WADbSearch3_whereClause)

WADbSearch3_whereClause=BuildFilterString("pagecategory","do_not_show_on_menu","AND NOT","Includes",0,WADbSearch3_wildCard,WADbSearch3_dateSeparator,WADbSearch3_whereClause)
'WADbSearch3_whereClause=BuildFilterString("siteside","" & cStr( Session("siteside") ) & "","AND","Includes",0,WADbSearch3_wildCard,WADbSearch3_dateSeparator,WADbSearch3_whereClause)

if (1 = 1) then
Session("WADbSearch3_search")=WADbSearch3_whereClause
end if
else
if (1 = 1) then
if (cStr(Session("WADbSearch3_search")) <> "") then
WADbSearch3_whereClause = cStr(Session("WADbSearch3_search"))
else
WADbSearch3_whereClause = WADbSearch3_DefaultWhere
end if
else
WADbSearch3_whereClause = WADbSearch3_DefaultWhere
end if
end if
%>

<%
Dim searchresults_pages__MMColParam
searchresults_pages__MMColParam = "do_not_show_on_menu"
If (Request("MM_EmptyValue") <> "") Then
searchresults_pages__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim searchresults_pages
Dim searchresults_pages_cmd
Dim searchresults_pages_numRows

Set searchresults_pages_cmd = Server.CreateObject ("ADODB.Command")
searchresults_pages_cmd.ActiveConnection = MM_khtml_STRING
searchresults_pages_cmd.CommandText = "SELECT * FROM content_cnt WHERE pagecategory <> ?"
searchresults_pages_cmd.Prepared = true
searchresults_pages_cmd.Parameters.Append searchresults_pages_cmd.CreateParameter("param1", 200, 1, 50, searchresults_pages__MMColParam) ' adVarChar

setQueryBuilderSource searchresults_pages_cmd, WADbSearch3_whereClause, false
Set searchresults_pages = searchresults_pages_cmd.Execute
searchresults_pages_numRows = 0
%>
<% ' END PAGES Search *****************************%>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...