%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%> <% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' DesigntimeType="ADO" ' HTTP="false" ' Catalog="" ' Schema="" Dim MM_cnnLOGH_STRING MM_cnnLOGH_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};" & _ "DBQ=" & Server.MapPath("\gDoc\logh.mdb") & ";" %> <% Dim rsLOGH2__MMColParam rsLOGH2__MMColParam = "1" If (Request.QueryString("Author") <> "") Then rsLOGH2__MMColParam = Request.QueryString("Author") End If %> <% Dim rsLOGH2 Dim rsLOGH2_numRows Set rsLOGH2 = Server.CreateObject("ADODB.Recordset") rsLOGH2.ActiveConnection = MM_cnnLOGH_STRING rsLOGH2.Source = "SELECT * FROM author WHERE Author = '" + Replace(rsLOGH2__MMColParam, "'", "''") + "'" rsLOGH2.CursorType = 0 rsLOGH2.CursorLocation = 2 rsLOGH2.LockType = 3 rsLOGH2.Open() rsLOGH2_numRows = 0 %> <% Dim rsLOGH__MMColParam rsLOGH__MMColParam = "1" If (Request.QueryString("Author") <> "") Then rsLOGH__MMColParam = Request.QueryString("Author") End If %> <% Dim rsLOGH Dim rsLOGH_numRows Set rsLOGH = Server.CreateObject("ADODB.Recordset") rsLOGH.ActiveConnection = MM_cnnLOGH_STRING rsLOGH.Source = "SELECT id, Subject, Date FROM article WHERE Author = '" + Replace(rsLOGH__MMColParam, "'", "''") + "'" rsLOGH.CursorType = 0 rsLOGH.CursorLocation = 2 rsLOGH.LockType = 1 rsLOGH.Open() rsLOGH_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 rsLOGH_numRows = rsLOGH_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim rsLOGH_total Dim rsLOGH_first Dim rsLOGH_last ' set the record count rsLOGH_total = rsLOGH.RecordCount ' set the number of rows displayed on this page If (rsLOGH_numRows < 0) Then rsLOGH_numRows = rsLOGH_total Elseif (rsLOGH_numRows = 0) Then rsLOGH_numRows = 1 End If ' set the first and last displayed record rsLOGH_first = 1 rsLOGH_last = rsLOGH_first + rsLOGH_numRows - 1 ' if we have the correct record count, check the other stats If (rsLOGH_total <> -1) Then If (rsLOGH_first > rsLOGH_total) Then rsLOGH_first = rsLOGH_total End If If (rsLOGH_last > rsLOGH_total) Then rsLOGH_last = rsLOGH_total End If If (rsLOGH_numRows > rsLOGH_total) Then rsLOGH_numRows = rsLOGH_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (rsLOGH_total = -1) Then ' count the total records by iterating through the recordset rsLOGH_total=0 While (Not rsLOGH.EOF) rsLOGH_total = rsLOGH_total + 1 rsLOGH.MoveNext Wend ' reset the cursor to the beginning If (rsLOGH.CursorType > 0) Then rsLOGH.MoveFirst Else rsLOGH.Requery End If ' set the number of rows displayed on this page If (rsLOGH_numRows < 0 Or rsLOGH_numRows > rsLOGH_total) Then rsLOGH_numRows = rsLOGH_total End If ' set the first and last displayed record rsLOGH_first = 1 rsLOGH_last = rsLOGH_first + rsLOGH_numRows - 1 If (rsLOGH_first > rsLOGH_total) Then rsLOGH_first = rsLOGH_total End If If (rsLOGH_last > rsLOGH_total) Then rsLOGH_last = rsLOGH_total End If End If %> <% Dim MM_paramName %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters Dim MM_keepNone Dim MM_keepURL Dim MM_keepForm Dim MM_keepBoth Dim MM_removeList Dim MM_item Dim MM_nextItem ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" End If MM_keepURL="" MM_keepForm="" MM_keepBoth="" MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each MM_item In Request.QueryString MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item)) End If Next ' add the Form variables to the MM_keepForm string For Each MM_item In Request.Form MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm If (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) End If If (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) End If If (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) End If ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %>
|
作者簡介
|
作品一覽
共有文章: <%=(rsLOGH_total)%> 篇 |
||||||||||||
<% rsLOGH2.Close() Set rsLOGH2 = Nothing %> <% rsLOGH.Close() Set rsLOGH = Nothing %>