%@ Language=VBScript EnableSessionState=False%>
|
|
<% selection = trim(request.querystring("selection")) Dim oConn Dim oRs Dim Mv ' Direction to move Dim PageNo ' Keep track of the page we're on. Populated from Form var Dim j ' Cobol style loops! Dim i Dim cnpath selection = "all" ' Create ADO Connection Component to connect with ' sample database Set oConn = Server.CreateObject("ADODB.Connection") cnpath="DBQ=" & server.mappath("music.mdb") oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath ' Create ADO Recordset Component Set RS = Server.CreateObject("ADODB.Recordset") ' Determine what PageNumber the scrolling currently is on Mv = Request("Mv") If Request("PageNo") = "" Then PageNo = 1 Else PageNo = Request("PageNo") End If RS.Open "SELECT Albums.ID, Albums.Title, Albums.CDNOW, Albums.CDNOW_Clips, Albums.`Release Date`, Albums.Label, Artists.Name, Songs.Albums_ID, Songs.Title as SongTitle, Songs.Lyrics, Songs.Posted, Songs.Lyrics, Songs.ID as SongID FROM Albums, Artists, Songs WHERE Albums.Artist_ID = Artists.ID and Songs.Albums_ID = Albums.ID ORDER BY Songs.Title", oConn, adOpenStatic RS.PageSize = 150 ' Adjust PageNumber as Appropriate If Mv = "Page Up" or Mv = "Page Down" Then Select Case Mv Case "Page Up" If PageNo > 1 Then PageNo = PageNo - 1 Else PageNo = 1 End If Case "Page Down" If RS.AbsolutePage < RS.PageCount Then PageNo = PageNo + 1 Else PageNo = RS.PageCount End If Case Else PageNo = 1 End Select End If RS.AbsolutePage = PageNo %>
|
|
|