<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% srch = "" if request.QueryString("srch") <> "" then srch = request.QueryString("srch") if request.form("srch") <> "" then srch = request.form("srch") ' ------ the form takes precedence -----' opt = "" if request.QueryString("o") <> "" then opt = request.QueryString("o") ord = "edition, disc, track" select case opt case "A" ord = "artist, " & ord case "T" ord = "title, " & ord end select if srch <> "" then where = " WHERE artist LIKE '%" & srch & "%' or title LIKE '%" & srch & "%'" Set rs = Server.CreateObject("ADODB.Recordset") rs.ActiveConnection = MM_nconn_STRING rs.Source = "SELECT * FROM NowCDs " & where & " ORDER BY " & ord & ";" rs.CursorType = 1 rs.CursorLocation = 2 rs.LockType = 1 rs.Open() rs_numRows = 0 rc = 0 while not rs.eof rc = rc + 1 rs.movenext wend if rc > 0 then rs.movefirst() maxres = 10000 %> AB - data

Now That's What I Call Music CD Listing

<% if srch <> "" then %>

You searched for : "<%=srch%>"

<% end if %>
 
<% if rc > 0 then response.write("

Results found: " & rc & "

") if opt = "" then %> <% rc = 1 : oed = 0 : odsk = 0 while not rs.EOF and rc <= maxres ed = rs("edition") if ed <> oed then oed = ed %> <% end if dsk = rs("disc") if dsk <> odsk and srch <> "" then odsk = dsk %> <% end if artist = rs("artist") title = rs("title") if srch <> "" then artist = highlite(artist,srch) title = highlite(title,srch) end if %> <% rc = rc + 1 rs.MoveNext() Wend %>
Now That's What I Call Music
<%=" " & ed%>
- <%=rs("tdate")%>
Disc <%=" " & dsk%>
    Track Artist Title
<%=rc%>. <%=dsk%> <%=rs("track")%> <%=artist%> <%=title%>
<% else ' --- opt = blank ---' %> <% while not rs.EOF artist = rs("artist") title = rs("title") if srch <> "" then artist = highlite(artist,srch) title = highlite(title,srch) end if bg = "" if opt = "A" then if artist <> oart then bg = " bgcolor=""#eef""" oart = artist end if else end if %> > <% rs.MoveNext() Wend %>
Now CD Dsc / Trk Artist Title Date
<%=rs("edition")%>
<%=rs("disc")%> <%= "/" & rs("Track")%> <%=artist%> <%=title%> <%=rs("tdate")%>
<% end if ' opt ------- ' %>

 

 

<% rs.Close() set rs = nothing %> <% '########################### Function Highlite(strText, strFind) strBefore = "" strAfter = "" nLen = Len(strFind) nLenAll = nLen + Len(strBefore) + Len(strAfter) + 1 Highlite = strText If nLen > 0 And Len(Highlite) > 0 Then nPos = InStr(1, Highlite, strFind, 1) Do While nPos > 0 Highlite = Left(Highlite, nPos - 1) & _ strBefore & Mid(Highlite, nPos, nLen) & strAfter & _ Mid(Highlite, nPos + nLen) nPos = InStr(nPos + nLenAll, Highlite, strFind, 1) Loop End If End Function %>