<%@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 DIM strYear DIM sqlWhere dim sql, sqlExtra, kind dim rsRefID, rsTitle, rsAuthors, rsPeriodical, rsYear, rsVol, rsIss, rsPage1, rsPage2, rsTitleSecond, tmpStr, strRequest %> TBI: Presentations
<% '===================================== '========= Create sql query ========== '===================================== strYear = Request.QueryString("year") If Err.number <> 0 then TrapError Err.description End If 'error check sqlExtra=" AND [Pub Date]= 2007" 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 '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, Periodical, Volume, Issue, [Pub Date], [Start Page], [End Page], [Title, secondary], [User Def 1], [User Def 3], [Web/URL] FROM publications WHERE [User Def 1]='Presentation'" + 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 %>

PRESENTATIONS



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 %> <% '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
Location
Request
<%=replace(rsAuthors,";","
")%>
<%=breakString(rsTitle,20)%>
<%=tmpStr%>
<%=breakString(oRS.Fields.Item("User Def 3").Value,20)%>
<% ProcessErrors 'process any errors that occured %>
<% oRS.Close() Set oRS = Nothing oConn.close() set oConn = Nothing %>