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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two ASP recordset queries from two tables in Access to create 1 table

Status
Not open for further replies.

pixelRONIN

Technical User
Apr 11, 2003
9
US
Hello,

I have parsed a whatever-delimited txt file this way. Thanks George for the the reply!
==============================================
<%

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? I 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 function build the program info in the table header then strip in the playlist info accordingly per which user queries?
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