%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% ' FileName="Connection_ado_conn_string.htm" ' Type="ADO" ' DesigntimeType="ADO" ' HTTP="false" ' Catalog="" ' Schema="" Dim MM_directory_STRING MM_directory_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\home\hnt7c164\database\directory.mdb" %> <% set rsCat = Server.CreateObject("ADODB.Recordset") rsCat.ActiveConnection = MM_directory_STRING rsCat.Source = "SELECT *, (SELECT COUNT (*) FROM LINKS WHERE LINKS.CAT_ID = CATS.CAT_ID AND LINK_APPROVED = 1) AS LINK_COUNT FROM CATS ORDER BY CAT_NAME ASC" rsCat.CursorType = 0 rsCat.CursorLocation = 2 rsCat.LockType = 3 rsCat.Open() rsCat_numRows = 0 %> <% set rsSub = Server.CreateObject("ADODB.Recordset") rsSub.ActiveConnection = MM_directory_STRING rsSub.Source = "SELECT * FROM SUBS ORDER BY SUB_NAME ASC" rsSub.CursorType = 0 rsSub.CursorLocation = 2 rsSub.LockType = 3 rsSub.Open() rsSub_numRows = 0 %> <% set rsHot = Server.CreateObject("ADODB.Recordset") rsHot.ActiveConnection = MM_directory_STRING rsHot.Source = "SELECT *, (LINK_RATE/NO_RATES) AS RATING FROM LINKS WHERE LINK_APPROVED = 1 ORDER BY NO_HITS DESC" rsHot.CursorType = 0 rsHot.CursorLocation = 2 rsHot.LockType = 3 rsHot.Open() rsHot_numRows = 0 %> <% set rsNew = Server.CreateObject("ADODB.Recordset") rsNew.ActiveConnection = MM_directory_STRING rsNew.Source = "SELECT * FROM LINKS WHERE LINK_APPROVED = 1 ORDER BY LINK_DATE DESC" rsNew.CursorType = 0 rsNew.CursorLocation = 2 rsNew.LockType = 3 rsNew.Open() rsNew_numRows = 0 %> <% FUNCTION CropSentence(strText, intLength, strTrial) Dim wsCount Dim intTempSize Dim intTotalLen Dim strTemp wsCount = 0 intTempSize = 0 intTotalLen = 0 intLength = intLength - Len(strTrial) strTemp = "" IF Len(strText) > intLength THEN arrTemp = Split(strText, " ") FOR EACH x IN arrTemp IF Len(strTemp) <= intLength THEN strTemp = strTemp & x & " " END IF NEXT CropSentence = Left(strTemp, Len(strTemp) - 1) & strTrial ELSE CropSentence = strText END IF END FUNCTION %> <% Dim HLooper1__numRows HLooper1__numRows = -2 Dim HLooper1__index HLooper1__index = 0 rsCat_numRows = rsCat_numRows + HLooper1__numRows %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each Item In Request.QueryString NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item)) End If Next ' add the Form variables to the MM_keepForm string For Each Item In Request.Form NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(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) if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) ' 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 %>
| ||||||||||||||||||||||||||||