Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic ASP tbl generation from 2 Access tbls into 1 ASP tbl

Status
Not open for further replies.

pixelRONIN

Technical User
Apr 11, 2003
9
0
0
US
Hello, I was wondering if it is possible to build one dynamic table from two tables in the same Access db? I’m doing a Web site, pro-bono, for a community supported radio station in Austin, TX KMFA Classical 89.5. They have one db table that has their programming info and an other that is a db of their playlist that is updated via a tab-delimited txt file in the below parser. My request is if there is a way to build a table header from the programming tbl, then strip in the songs accordingly?

So, I have parsed a whatever-delimited txt file this way
==============================================
<%

DIM databaseMonths(12)
databaseMonths(0) = &quot;jan&quot;
databaseMonths(1) = &quot;feb&quot;
databaseMonths(2) = &quot;mar&quot;
databaseMonths(3) = &quot;apr&quot;
databaseMonths(4) = &quot;may&quot;
databaseMonths(5) = &quot;jun&quot;
databaseMonths(6) = &quot;jul&quot;
databaseMonths(7) = &quot;aug&quot;
databaseMonths(8) = &quot;sep&quot;
databaseMonths(9) = &quot;oct&quot;
databaseMonths(10) = &quot;nov&quot;
databaseMonths(11) = &quot;dec&quot;

databaseYear = MID(REQUEST(&quot;yr&quot;),3,2)
'---SET VARIABLES AND OPEN DATA FILE
dim thepath
thepath = server.mappath(&quot;/cms/FileLib/&quot;) & &quot;\&quot;
Response.ContentType=&quot;application/vnd.ms-excel&quot;
set fso=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
'SET playlistObject = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
set file=fso_OpenTextFile(thepath & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)
'set file=fso_OpenTextFile(&quot;D:\Inetpub\'SET playlist = playlistObject.OpenTextFile(thepath & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)

size1=len(&quot; 12:00 AM &quot;)
size2=len(&quot;PROGRAM &quot;)
size3=len(&quot;Parisian Quartet No. 10 (Nouveau No. 4)&quot;)
%>
<table border=1 CELLPADDING=&quot;1&quot; CELLSPACING=&quot;1&quot; BORDERCOLOR=&quot;#FFFFFF&quot; BGCOLOR=&quot;#CCCCCC&quot;>
<%
function getLastNum(stext)
s=&quot;&quot;
for i=len(stext) to 1 step -1
if mid(stext,i,1)<>&quot; &quot; then
s=s+mid(stext,i,1)
else
i=-1
end if
next
getLastNum=s
end function
while not file.AtEndOfStream
sline=file.ReadLine
if sline<>&quot; &quot; AND sline<>&quot;&quot; then
if instr(1,sline,&quot;PLAY DATE:&quot;)=0 then
stime=left(sline,size1)
sline=replace(sline,stime,&quot;&quot;)

stype=left(sline,size2)
sline=replace(sline,stype,&quot;&quot;)

snumber=&quot;&quot;
snumber=CStr(getNum(sline))
sline=replace(sline,snumber,&quot;&quot;)

slastnumber=getLastNum(sline)
sline=replace(sline,slastnumber,&quot;&quot;)

stitle=left(sline,size3)
sprod=replace(sline,stitle,&quot;&quot;)

if snumber<>&quot;1.#QNAN&quot; then
%>
<tr BORDERCOLOR=&quot;#FFFFFF&quot;>
<td><font size=2><%=stime%></font>
</td>
<td><font size=2><%=stype%></font>
</td>
<td><font size=2><%=snumber%></font>
</td>
<td><font size=2><%=stitle%></font>
</td>
<td><font size=2><pre><%=sprod%></pre></font>
</td>
<td><font size=2><pre><%=slastnumber%></pre></font>
</td>
</tr>
<%
end if
else
%>
<tr>
<td colspan=6 BORDERCOLOR=&quot;#FFFFFF&quot;><font size=3><b><%=sline%></b></font>
</td>
</tr>
<%
end if
end if
wend
%>
</table>
<script language=javascript runat=&quot;server&quot;>
function getNum(str)
{
return parseInt(str)
}
</script>
<%
rsPLAYlist.Close()
Set rsPLAYlist = Nothing
%>
=============================================

This creates a excel wrkbok that I can manage to export a tab-delimited file into Access then use my limited experience in, <embarrassed> MM Dreamweaver to display the recordset by three session variables:
1) current time
2) Current day
3) Current month
I hate to go the well on this thread, but do you know how I could merge two Access tables by one criteria/variable? Ideally, I would like the time query to set the db in action then display the playlist by time, day, month under the table header that contains the programming information from the radio stations program Access db. I'm mean, I have one table that contains the station programming information, and then I have this playlist file residing in another table. Is it possible to have a faction build the program info in the table header then strip in the playlist info accordingly?
For I would like to have the user to see what playing by those three criteria - this was gleaned from a survey.
More importantly - I would like to have the front page display the current composition, real-time, via a timer that queries the db for the current:
1) composition title
2) composer
3) program title/description
4) announcer bio

I have bitten off WAY more than I can chew. I would greatly appreciate any help you could offer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top