<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit %> <%On Error Resume Next%> <% '====================================================== '===== FUNCTION: if string is > n char then break ===== '====================================================== function breakString( s , n ) dim a, tmpArray, tmpStr tmpArray=split(s," ") tmpStr="" for a = 0 to ubound(tmpArray) if len(tmpArray(a))>n then tmpArray(a)= left(tmpArray(a),n) + " " + mid(tmpArray(a),n+1) end if if a = 0 then tmpStr = tmpArray(a) else tmpStr = tmpStr + " " + tmpArray(a) end if next breakString = tmpStr end function '==================End Function================ dim PMID, PMIDlink 'pub med id dim rowCnt Dim formSQL, qStringSQL, i DIM strYear dim sql, sqlExtra, kind dim strChkJournal, strChkBook, strStartYear, strEndYear, keyword dim strTitleKey, strAuthorKey, strAbstractKey dim titleKey, authorKey, abstractKey dim rsRefID, rsTitle, rsAuthors, rsPeriodical, rsYear, rsVol, rsIss, rsPage1, rsPage2, rsTitleSecond, tmpStr, strRequest %> CNNR: Publications
<% '===================================== '========= Create sql query ========== '===================================== strYear = Request.QueryString("year") if request.form("keywordType") = "Author Last Name" then strKeywordType = "Authors" else strKeywordType = request.form("keywordType") end if strTitleKey = request.form("titleKey") strAuthorKey = request.form("authorKey") strAbstractKey = request.form("abstractKey") strKeywords = request.form("keywords") strChkJournal = request.form("chkJournal") strChkBook = request.form("chkBook") strStartYear = request.form("startYear") strEndYear = request.form("endYear") If Err.number <> 0 then TrapError Err.description End If 'error check IF strYear <> "" THEN 'if only pub year is passed If strYear = 2002 Then sqlExtra=" AND [Pub Date]<=" + cstr(strYear) elseif strYear = 0 then sqlExtra="" else sqlExtra=" AND [Pub Date]=" + cstr(strYear) End If ELSEIF strTitleKey <> "" OR (strAuthors <> "" AND strAuthors <> "Any") OR strAbstractKey <> "" OR strChkJournal <> "" OR strChkBook <> "" OR strStartYear <> "" OR strEndYear <> "" THEN sqlExtra = "" 'response.Write("sqlExtra 1 = " & sqlExtra & "
") '======== Keywords =========== if strTitleKey <> "" then strTitleKey = trim(strTitleKey) sqlExtra = sqlExtra & " AND [Title] LIKE '%" & strTitleKey & "%'" end if if strAuthorKey <> "" AND strAuthorKey <> "Any" then strAuthorKey = trim(strAuthorKey) sqlExtra = sqlExtra & " AND [Authors] LIKE '%" & strAuthorKey & "%'" end if if strAbstractKey <> "" then strAbstractKey = trim(strAbstractKey) sqlAbstractKey = " AND [Abstract] LIKE '% " & strAbstractKey & " %'" end if ' response.Write("sqlExtra 2 = " & sqlExtra & "
") '======== Journal Checkbox ========= if strChkJournal <> "" then sqlExtra = sqlExtra & " AND ([Ref Type]='JOUR')" end if '======== Book Chapter Checkbox ========= if strChkBook <> "" then if strChkJournal <> "" then 'remove previous ")" and add OR sqlExtra = left(sqlExtra, len(sqlExtra)-1) & " OR " else sqlExtra = sqlExtra & " AND (" end if sqlExtra = sqlExtra & "[Ref Type]='CHAP')" end if 'response.Write("sqlExtra 3 = " & sqlExtra & "
") '======== DATE Range ========= if strStartYear <> "" and strEndYear <> "" then sqlExtra = sqlExtra & " AND ([Pub Date] BETWEEN " & strStartYear & " AND " & strEndYear & ")" end if 'ELSE 'response.Write("Error: Invalid or No query was submitted.") ' Stop all execution after this line. 'Response.End END IF ' response.Write("sqlExtra 4 = " & sqlExtra & "
") '============================= '== Connect to DB === '============================= Dim oConn, oCmd, oRS Dim sConnectionString, MdbFilePath MdbFilePath = Server.MapPath("../pub_database/cnnr00.mdb") sConnectionString="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";" Set oConn = Server.CreateObject("ADODB.Connection") 'oConn.Mode = 3 '3 = adModeReadWrite oConn.Open sConnectionString Set oCmd = Server.CreateObject("ADODB.Command") oCmd.ActiveConnection = oConn sql = "SELECT [Ref ID], Title, Authors, Abstract, Periodical, Volume, Issue, [Pub Date], [Start Page], [End Page], [Title, secondary], [User Def 1], [Web/URL] FROM publications WHERE [User Def 1]='Publication'" + sqlExtra + " ORDER BY [Pub Date] DESC, Title ASC" 'response.Write("sql = " & sql) oCmd.CommandText = sql 'oCmd.CommandType = 1 'adCmdText oCmd.Prepared = true Set oRS = oCmd.Execute If Err.number <> 0 then TrapError Err.description End If 'error check %>

PUBLICATIONS



Click onPubMed Iconto view abstracts from the National Library of Medicine database.

To request an article select the checkbox for the appropriate article(s) and click "Submit Request".


<% rowCnt=2 While NOT oRS.EOF rsRefID = cstr(oRS.Fields.Item("Ref ID").Value) rsTitle = breakString(cstr(oRS.Fields.Item("Title").Value),20) rsAuthors = cstr(oRS.Fields.Item("Authors").Value) rsPeriodical = cstr(oRS.Fields.Item("Periodical").Value) rsTitleSecond = cstr(oRS.Fields.Item("Title, secondary").Value) rsYear = cstr(oRS.Fields.Item("Pub Date").Value) rsVol = cstr(oRS.Fields.Item("Volume").Value) rsIss = cstr(oRS.Fields.Item("Issue").Value) rsPage1 = cstr(oRS.Fields.Item("Start Page").Value) rsPage2 = cstr(oRS.Fields.Item("End Page").Value) tmpStr="" if (rowCnt mod 2) = 0 then 'if row is even response.Write("") else response.Write("") end if rowCnt=rowCnt+1 %> <% 'Periodical if rsPeriodical <> "" then tmpStr = rsPeriodical else tmpStr = rsTitleSecond end if 'Year if rsYear<>"" and tmpStr<>"" then tmpStr = tmpStr + ", " + rsYear elseif rsYear<>"" and (rsVol<>"" OR rsIss<>"" OR rsPage1<>"" OR rsPage2<>"") then tmpStr = tmpStr + " " + rsYear end if 'Punctuation: "." if (rsPeriodical<>"" OR rsTitleSecond<>"") AND rsYear<>"" AND (rsVol<>"" OR rsIss<>"" OR rsPage1<>"" OR rsPage2<>"") then tmpStr = tmpStr + "." end if 'Volume if rsVol<>"" then tmpStr = tmpStr + " " + rsVol end if 'Issue if rsIss<>"" and rsVol<>"" then tmpStr = tmpStr + "(" + rsIss + ")" elseif rsIss<>"" and rsVol="" then tmpStr = tmpStr + " (" + rsIss + ")" end if 'Punctuation: ":" if (rsVol<>"" OR rsIss<>"") AND (rsPage1<>"" OR rsPage2<>"") then tmpStr = tmpStr + ":" end if 'Pages if rsPage1<>"" and rsPage2<>"" then tmpStr = tmpStr + " p. " + rsPage1 + "-" + rsPage2 elseif rspage1<>"" then tmpStr = tmpStr + " p. " + rsPage1 elseif rsPage2<>"" then tmpStr = tmpStr + " p. " + rsPage2 end if %> <%PMID=(oRS.Fields.Item("Web/URL").Value) if PMID <> "" then PMID=right(PMID,len(PMID)-3) PMIDlink = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=" & PMID Response.Write("") else Response.Write("") end if 'Create Request Checkbox 'Create string to place into EACH checkbox. This is what will be sent to the process request page. ' "[[[]]]" will be my text qualiier for delimiting on the "processRequest.asp" page strRequest = "[[[" + rsRefID + chr(9) + rsTitle + chr(9) + rsAuthors + chr(9) + tmpStr + "]]]" %> <% oRS.MoveNext() If Err.number <> 0 then TrapError Err.description End If 'error check Wend %>
Authors
Title
Reference
Abstract
Request
<%=replace(rsAuthors,";","
")%>
<%=breakString(rsTitle,20)%>
<%=tmpStr%>
N/A
<% ProcessErrors 'process any errors that occured %>
<% oRS.Close() Set oRS = Nothing oConn.close() set oConn = Nothing Session.Abandon %>