Home
 

Home
Login
Alzheimer's disease
Bipolar disorder
Depression
Schizophrenia
Links and resources
Discussion boards
Feedback
Support
Power search
Power search


This page is currently in development


 

<% Function WriteSelectBox(strIDField,strDesc,strTable) Dim i, rstChecks, strChecks Set rstChecks = connObj.Execute("SELECT "&strIDField&", "&strDesc&" FROM " &strTable) While Not rstChecks.EOF strChecks=strChecks&"" rstChecks.MoveNext Wend rstChecks.Close WriteSelectBox=strChecks End Function Sub DisplayResults() Dim strSQL, rstArticles, strArea, strSearch strSearch=Request.Form("txtSearch") strArea=Request.Form("selArea") strKeyword=Request.Form("txtkeyword") strPublishedWithin=Request.Form("selPublished") 'strSQL= "SELECT DISTINCT tblArticle.ArticleID, tblArticle.PublishDate, tblArticle.Title, tblArticle.Author, tblArea.Description FROM tblArticle INNER JOIN tblParagraph ON tblArticle.articleID=tblParagraph.ArticleID INNER JOIN tblArticle_Area ON tblArticle.articleID=tblArticle_Area.ArticleID INNER JOIN tblArea ON tblArticle_Area.areaID=tblArea.areaID WHERE tblParagraph.Title LIKE '%"&strSearch&"%' OR tblParagraph.Body LIKE '%"&strSearch&"%' AND tblArticle.Status=1" strSQL= "SELECT DISTINCT tblArticle.ArticleID, tblArticle.PublishDate, tblArticle.Title, tblArticle.Author, tblArea.Description, tblArea.AreaID FROM tblArticle INNER JOIN tblParagraph ON tblArticle.articleID=tblParagraph.ArticleID INNER JOIN tblArticle_Area ON tblArticle.articleID=tblArticle_Area.ArticleID INNER JOIN tblArea ON tblArticle_Area.areaID=tblArea.areaID WHERE (tblParagraph.Title LIKE '%"&strSearch&"%' OR tblParagraph.Body LIKE '%"&strSearch&"%') AND (tblArticle.Status=1)" If Not Trim(strPublishedWithin)="" Then strSQL=strSQL& " AND (tblArticle.PublishDate > '"& DateAdd("d",-CInt(strPublishedWithin),Now()) &"')" End If If Not Trim(strKeyword)="" Then strSQL=strSQL& " AND (tblArticle.Keywords LIKE '%" &strKeyword& "%')" End If If strArea="0" Then strSQL=strSQL& " ORDER BY PublishDate DESC" Else strSQL=strSQL& " AND (tblArea.AreaID=" &strArea& ") ORDER BY PublishDate DESC" End If Set rstArticles = connObj.Execute(strSQL) Dim lastID If Not rstArticles.EOF Then Response.Write "The following articles were found, matching your search:

REMEMBER: You need to be logged in to read the articles.
" Response.Write "" While Not rstArticles.EOF If lastID=rstArticles("ArticleID") Then Response.Write ", " &rstArticles("description") Else Response.Write "
  • " &rstArticles("Title")& " by " &rstArticles("Author")& "
    Therapy area : " &rstArticles("description") End If lastID=rstArticles("ArticleID") rstArticles.MoveNext Wend Else Response.Write "No articles matched your search. Go back and try another search.

    Remember to separate multiple keywords with commas" End If rstArticles.Close Response.Write "

    " End Sub Sub WriteSearchForm() %> You can search all published articles on emental-health.com. All fields are optional.

    Multiple keywords should be separated by a comma
    Text:
    Keyword:
    Published within:
    Therapy area:
    <% End Sub %>