Hey thanks,
I have one Access db for the site; within the db are two tables. One table contains the station’s programming info. The other is the one table created by the imported playlist txt file. The programming table has fields, which are defined by the days of the week for the entire month. For example:
ID DayOfWeek StartTime EndTime ProgramTitle
1 Sun 12:00 am 6:00 am A Lot of Night Music
The second table is the one created by the imported txt file. The site, in it inception, had the following legacy code:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%
DIM databaseMonths(12)
databaseMonths(0) = "jan"
databaseMonths(1) = "feb"
databaseMonths(2) = "mar"
databaseMonths(3) = "apr"
databaseMonths(4) = "may"
databaseMonths(5) = "jun"
databaseMonths(6) = "jul"
databaseMonths(7) = "aug"
databaseMonths(8) = "sep"
databaseMonths(9) = "oct"
databaseMonths(10) = "nov"
databaseMonths(11) = "dec"
databaseYear = MID(REQUEST("yr"

,3,2)
'------------------ NOTE ---------------------'
' '
' UNCOMMENT (-AND COMMENT OUT-) THE '
' APPROPRIATE PATH INFO "BEFORE" UPLOADING '
' TO FREESIDE OR EDITING ON BOGART IN '
' '
' "SET VARIABLES AND OPEN DATA FILE" BELOW '
' '
'-----------------------------------------------'
'---SET VARIABLES AND OPEN DATA FILE
dim thepath
thepath = server.mappath("/cms/FileLib/"

& "\"
SET playlistObject = Server.CreateObject("Scripting.FileSystemObject"

SET playlistCount = playlistObject.OpenTextFile(thepath & databaseMonths(REQUEST("mo"

-1) & databaseYear & ".txt"
'SET playlistCount = playlistObject.OpenTextFile("\\Grace\web\kmfa01\playlists\" & databaseMonths(REQUEST("mo"

-1) & databaseYear & ".txt"

SET playlist = playlistObject.OpenTextFile(thepath & databaseMonths(REQUEST("mo"

-1) & databaseYear & ".txt"

'SET playlist = playlistObject.OpenTextFile("\\Grace\web\kmfa01\playlists\" & databaseMonths(REQUEST("mo"

-1) & databaseYear & ".txt"
if nomonth = "" then
i=0
p=0
bgc="#dddddd"
'---GET LINE COUNT
WHILE NOT playlistCount.AtEndOfStream
x=playlistCount.ReadLine
if x="nodata" then
absent=true
end if
p=p+1
WEND
'---SET PLAYLIST ARRAY TO CORRECT COUNT
DIM playlistArray()
REDIM playlistArray(p)
'---PARSE PLAY LIST LINE BY LINE
WHILE NOT playlist.AtEndOfStream
playlistArray(i)=(playlist.ReadLine)
i=i+1
WEND
playlist.CLOSE
'---THE FUNCTIONS
FUNCTION dateHeader(theDate)
RESPONSE.WRITE("<table width='100%' border='0' cellpadding=0 cellspacing=1><tr><td bgcolor='#000000'>"

RESPONSE.WRITE("<font face='Arial, Helvetica' size='-1' color='#000000'><b>.</b></font>"

RESPONSE.WRITE("<font face='Arial, Helvetica' size='-1' color='#ffffff'><b>" & theDate & "</b></font>"

RESPONSE.WRITE("</td></tr></table>"

END FUNCTION
FUNCTION ditties(theTime,theComposer,thePiece,theSong,theLabel,theSpine)
IF bgc="#eeeeee" THEN
bgc="#dddddd"
ELSE
bgc="#eeeeee"
END IF
amSearch="javascript:amazonCheck('" & TRIM(theSong) & "','" & TRIM(theComposer) & "','','')"
limitedSearch="javascript:amazonCheck('','','','" & TRIM(theSpine) &"')"
' snagTableHeader(theTime)
RESPONSE.WRITE("<tr>"

RESPONSE.WRITE("<td valign='top' bgcolor='" & bgc & "' width='50'>"

RESPONSE.WRITE("<font face='Arial, Helvetica' size='-2'>" & theTime & "</font></td>"

RESPONSE.WRITE("<td valign='top' bgcolor='" & bgc & "'><table border=0 width='100%'cellspacing=0 cellpadding=0><tr><td valign='top' width='35%'>"

RESPONSE.WRITE("<font face='Arial, Helvetica' color='#333333' size='-1'><b>" & theComposer & "</b></font></td>"

' RESPONSE.WRITE("<td valign='top' bgcolor='" & bgc & "'>"

' RESPONSE.WRITE("<font face='Arial, Helvetica' size='-1'>" & thePiece & "</font>"

' RESPONSE.WRITE("<td valign='top' bgcolor='" & bgc & "'>"

RESPONSE.WRITE("<td width='65%' valign='top'><font face='Arial, Helvetica' size='-1'>" & theSong & "</font></td></tr></table>"

' RESPONSE.WRITE("<td colspan=2 valign='top' bgcolor='" & bgc & "'>"

RESPONSE.WRITE("<font face='Arial, Helvetica' size='-1'><b>Label:</b> " & theLabel & " </font>"

'RESPONSE.WRITE("<td valign='top' bgcolor='" & bgc & "'>"

RESPONSE.WRITE(" "

RESPONSE.WRITE("<font face='Arial, Helvetica' size='-1'><b>Spine Number:</b> " & theSpine & "</font>"

' amazon links
'RESPONSE.WRITE("<br><font face='Arial, Helvetica' size='-2'>Search Amazon.com by <a href=" & CHR(034) & amSearch & CHR(034) & "><img src='../images/artistandpiece.gif' border=0 align='absmiddle'></a> or by <a href=" & CHR(034) & limitedSearch & CHR(034) & "><img src='../images/performance.gif' border=0 align='absmiddle'></a></font></td>"

RESPONSE.WRITE("<br><font face='Arial, Helvetica' size='-2'>Amazon links temporarily unavailable. <b>Use the Amazon search above</b></font></td>"
RESPONSE.WRITE("</tr>"

END FUNCTION
'---STRIP CHARS
numbers="0123456789"
LastNum=0
ThisNum=0
NextNum=0
FUNCTION timeStripper(xxx)
TempNum=""
FOR s=1 TO LEN(xxx)
IF InStr(numbers,MID(xxx,s,1))>0 THEN
TempNum=TempNum & MID(xxx,s,1)
END IF
NEXT
IF InStr(xxx,"PM"

>0 AND NOT InStr(xxx,"12:"

>0 THEN
TempNum=TempNum+1200
END IF
timeStripper=TempNum
END FUNCTION
'---SET PROGRAM TITLES ARRAY
FUNCTION snagTableHeader(programTime)
NextNum=timeStripper(timeStripper(programTime))
FOR pTime=0 TO UBOUND(programHeaderTable)
ThisNum=timeStripper(timeStripper(programHeaderTable(pTime,1)))
IF ThisNum<=NextNum AND ThisNum>LastNum THEN
Response.Write(programHeaderTable(pTime,0))
END IF
NEXT
LastNum=NextNum
NextNum=""
END FUNCTION
'---GET REQUESTED DATE FROM QUERY
BEGIN=REQUEST("dy"

& ", " & REQUEST("mo"

& "/" & REQUEST("dt"

& "/" & REQUEST("yr"

WRITING=FALSE
'---SNAG THE HEADERS
'SET schedule=Server.CreateObject("ADODB.Connection"

'schedule.Open "schedule"
'pullTable=" SELECT * FROM " & REQUEST("mo"

& REQUEST("yr"

& " "
'Set addRows=schedule.Execute(pullTable)
'Set pt=schedule.Execute(pullTable)
'rows=0
'r=0
'WHILE NOT addRows.EOF
' IF addRows("DayOfWeek"

=REQUEST("dy"

THEN
' rows=rows+1
' END IF
' addRows.MoveNext
'WEND
'DIM programHeaderTable()
'REDIM programHeaderTable(rows,1)
'a=0
'WHILE NOT pt.EOF
' IF pt("DayOfWeek"

=REQUEST("dy"

THEN
' programHeaderTable(r,0)="<tr><td colspan=2 bgcolor='#888888' valign='top' align='left'><font face='Arial, Helvetica' size='2' color='#ffffff'><b>" & pt("ProgramDescription"

& " </b><font size='-2'>" &(pt("StartTime"

& " - " & pt("EndTime"

& "</font></font></td></tr>"

' programHeaderTable(r,1)=pt("StartTime"

' r=r+1
' END IF
' pt.MoveNext
'WEND
'---ADD IN THE HEADER
dateHeader(BEGIN)
if absent = true then
response.write("<br><br> Sorry, no data available for Current Month <br><br>"

end if
'---ROLL THROUGH THE playlistArray PARSING THE STRINGS
qLength=0
goAhead="false"
IF REQUEST("dt"

="01" THEN
goAhead="true"
END IF
'FOR pHT=0 TO rows-1
' RESPONSE.WRITE(programHeaderTable(pHT,0))
' IF pHT<rows-1 THEN
' LastCheck=timeStripper(programHeaderTable(pHT+1,1))
' ELSE
' LastCheck=2401
' END IF
if REQUEST("yr"

="2000" and REQUEST("mo"

<>"12" then
FOR q=qLength to UBOUND(playlistArray)
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))>0 THEN
playTime=MID(playlistArray(q),1,9)
Composer=MID(playlistArray(q),10,32)
Piece=""
FOR s=42 TO LEN(playlistArray(q))-43
qq=MID(playlistArray(q),s,1)
IF qq="0" OR qq="1" OR qq="2" OR qq="3" OR qq="4" OR qq="5" OR qq="6" OR qq="7" OR qq="8" OR qq="9" THEN
Piece=Piece & MID(playlistArray(q),s,1)
ELSE
EXIT FOR
END IF
NEXT
Song=MID(playlistArray(q),42+LEN(Piece),40)
Label=MID(playlistArray(q),82+LEN(Piece),11)
Spine=MID(playlistArray(q),93+LEN(Piece),LEN(playlistArray(q))-92-LEN(Piece))
' a=timeStripper(playTime)*1
' b=timeStripper(programHeaderTable(pHT,1))*1
' c=LastCheck*1
' IF a>=b AND a<c THEN
qLength=qLength+1
z=ditties(playTime,Composer,Piece,Song,Label,Spine)
' ELSE
' EXIT FOR
' END IF
END IF
IF "PLAY DATE: "&BEGIN=TRIM(playlistArray(q)) OR goAhead="true" THEN
goAhead="false"
WRITING=TRUE
RESPONSE.WRITE("<table width='100%' border='0' cellspacing=1 cellpadding=0>"

END IF
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))=0 THEN
RESPONSE.WRITE("</table>"

EXIT FOR
END IF
NEXT
else
FOR q=qLength to UBOUND(playlistArray)
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))>0 THEN
playTime=MID(playlistArray(q),6,9)
Composer=MID(playlistArray(q),16,32)
Piece=""
FOR s=48 TO LEN(playlistArray(q))-49
qq=MID(playlistArray(q),s,1)
IF qq="0" OR qq="1" OR qq="2" OR qq="3" OR qq="4" OR qq="5" OR qq="6" OR qq="7" OR qq="8" OR qq="9" THEN
Piece=Piece & MID(playlistArray(q),s,1)
ELSE
EXIT FOR
END IF
NEXT
Song=MID(playlistArray(q),48+LEN(Piece),40)
Label=MID(playlistArray(q),88+LEN(Piece),11)
Spine=MID(playlistArray(q),99+LEN(Piece),LEN(playlistArray(q))-98-LEN(Piece))
' a=timeStripper(playTime)*1
' b=timeStripper(programHeaderTable(pHT,1))*1
' c=LastCheck*1
' IF a>=b AND a<c THEN
qLength=qLength+1
z=ditties(playTime,Composer,Piece,Song,Label,Spine)
' ELSE
' EXIT FOR
' END IF
END IF
'OR goAhead="true"
IF "PLAY DATE: "&BEGIN=TRIM(playlistArray(q)) THEN
goAhead="false"
WRITING=TRUE
RESPONSE.WRITE("<table width='100%' border='0' cellspacing=1 cellpadding=0>"

END IF
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))=0 THEN
RESPONSE.WRITE("</table>"

EXIT FOR
END IF
NEXT
end if
'NEXT
'schedule.Close
else
response.write(nomonth)
end if
%>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I have tried to get this code restored to its former functionality. No luck much has been changes by years of neglect and many chiefs in the kitchen. I think the code originally, displayed the playlist according to the day and month sent as requested variables from the calendar on the preceding page. The scripts then would build the header tables with the corresponding programming information based on the requested information. Then the table would fill out by being sorted by time.
I think.
Since I know very little about VBScript I thought it would be more manageable for my to use Access dbs within ASP pages and use the OOP in Dreamweaver to design/build the site. One quick question – the script you sent, inverts the lastNum to read backwards.
For example:
6:50 AM Johann (Jan Jiri) Benda 6862 Violin Concerto Naxos 553902 209355
The 553902 sequences is correct and I would need to trim off that number to not show in the same cell as the CD lable, in this case 553902 would not be displayed next to Naxos, just in the last cell.
Thanks so very much George!
-Cal