Active Server Page demo Online logs

Post your general comments about Winlog32 here.
Post Reply
G0CUZ
Site Admin
Posts: 461
Joined: Wed Jan 02, 2002 7:12 am

Active Server Page demo Online logs

Post by G0CUZ »

If you have ever considered having your log available online then it is possible to use directly Winlog32's log databases with an Active Server Page (ASP), I use the ASP facility at www.brinkster.com (and it's free!) for my own online log, use the following link to see how it works.

http://www14.brinkster.com/cuz/log.asp

I just uploaded my latest log database this evening (27 May 2002).

For anyone that is interested - here is the ASP code page that is used for my online log.
The ASP code page is a mixture of html and program code, it must be modified to suit your own requirements. Cut n' paste it into a 'notepad' file and make the necessary changes.

You will of course have to register with Brinkster before you can use their facility.

**************COPY ALL CODE BELOW THIS LINE*******************



<html>

<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252">
<title>Online Log Database</title>
</head>



<!-- YOU MUST ONLY EDIT THIS PAGE WITH A TEXT EDITOR -->
<!-- READ THROUGH IT CAREFULLY, TAKING NOTE OF ALL REMARKS ADDED -->
<!-- MAKE CHANGES WHERE SUGGESTED WITH REM LINES -->
<!-- IF YOU DO NOT MAKE THESE CHANGES - IT'S LIKELY IT WON'T WORK -->
<!-- DO NOT MAKE CHANGES TO OTHER AREAS OF PROGRAM CODE UNLESS YOU -->
<!-- KNOW WHAT YOU ARE DOING -->

<!-- THIS ASP PAGE HAS BEEN TESTED ONLY ON "WWW.BRINKSTER.COM" -->
<!-- IT MAY REQUIRE OTHER CHANGES TO WORK ON OTHER SERVERS -->

<!-- TAKE SPECIAL CARE WHEN MAKING CHANGES TO PROGRAM CODE -->
<!-- PROGRAM CODE RESIDES ON LINES BETWEEN % SYMBOLS -->
<!-- PROGRAM CODE IS INTERSPERSED WITH HTML -->


<!-- DELETE OR CHANGE THE NEXT LINE, IT'S A BACKGROUND IMAGE FILE -->

<body background="back32.gif">


<%

REM CHANGE "G0CUZ_CONN" in 'strCONN =' line to a unique variable - suggest substitute your callsign for mine
REM E.G. "MYCALL_CONN"

strCONN = "G0CUZ_CONN"

Param = Request.QueryString("Param")
Data = Request.QueryString("Data")
Start = Request.QueryString("Start")
Session.timeout = 30
If IsObject(Session(strCONN)) Then
Set conn = Session(strCONN)
Else
Set conn = Server.CreateObject("ADODB.Connection")

REM next line must be modified with the name of your Log database...................H E R E .....

conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db\G0CUZ.log") ,"",""

Set Session(strCONN) = conn
End If
DataNew = Data
DataNew = Replace(DataNew, "*", "%")

REM 'LOG' IN NEXT LINE MUST MATCH NAME OF YOUR LOG (the name that appears in the WL32 LOAD window).

sql = "SELECT * FROM LOG"

if cstr(param) = "DATE" then
sql = sql & " WHERE DATE = #" & cstr(DataNew) & "# ORDER BY DATE, STIME"

else
If cstr(Param) <> "" And cstr(Data) <> "" Then
sql = sql & " WHERE [" & cstr(Param) & "] LIKE '" & cstr(DataNew) & "' ORDER BY DATE, STIME"
End If

end if


Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
MaxFound = rs.recordcount

Select Case Param

Case "CALLSIGN": V1 = " selected "
Case "DATE": V2 = " selected "
Case "STIME": V3 = " selected "
Case "BAND": V4 = " selected "
Case "MODE": V5 = " selected "
Case "REMARKS": V6 = " selected "
Case "USER": V7 = " selected "
Case "QSLIN": V8 = " selected "
Case "QSLOUT": V9 = " selected "
Case "PROP": V10 = " selected "

End Select
%>

<form method="GET" action="LOG.asp">
<input type="hidden" name="Start" value="1"><div align="center"><center><p>
<font face="Arial" color="#0000A0"><strong>

<!-- ****YOU SHOULD CHANGE THE TEXT IN THE NEXT LINE TO YOUR LOG DATABASE NAME -->

G0CUZ ONLINE LOG DATABASE


</strong></font></p>

</center></div><div align="center"><center><p><select name="Param" size="1">

<!-- *YOU CAN DELETE ANY OF THE FOLLOWING FIELDS IF THEY ARE -->
<!-- *NOT REQUIRED IN THE DROP DOWN SEARCH LIST -->
<!-- *DELETE COMPLETE LINE OF CODE -->

<option <%=V1 %> value="CALLSIGN">CALLSIGN</option>
<option <%=V2 %> value="DATE">DATE</option>
<option <%=V3 %> value="STIME">STIME</option>
<option <%=V4 %> value="BAND">BAND</option>
<option <%=V5 %> value="MODE">MODE</option>
<option <%=V6 %> value="REMARKS">REMARKS</option>
<option <%=V7 %> value="USER">USER</option>
<option <%=V8 %> value="QSLIN">QSLIN</option>
<option <%=V9 %> value="QSLOUT">QSLOUT</option>
<option <%=V10 %> value="PROP">PROP</option>


</select><input type="text" name="Data" size="50" value="<%=Data%>"><input type="submit"
value="Search" name="B1"></p>
</center></div>
</form>
<% If MaxFound = 0 Then %>

<p align="center">Your search returned no matches <% Else %> <% If Param <> "" and Data <> "" Then %> Your search found <%=MaxFound%> match(es) <% End If %> <% End If %> <br>
<% If Param <> "" and Data <> "" Then %><% EndStart=Start+19
If EndStart > MaxFound then EndStart = MaxFound %>Displaying <%=Start%> - <%=EndStart%> of <%=MaxFound%> <% rem ** Next/Previous Matches Code **
if Start > 1 Then
BackURL="""log.asp?Start=" & Start - 20 & "&Param=" & Param & "&Data=" & Data & """"
Response.write "<A HREF=" & BackURL & ">Previous 20 Matches</A> "
end if
if EndStart < MaxFound Then
NextURL="""log.asp?Start=" & EndStart+1 & "&Param=" & Param & "&Data=" & Data & """"
NextMatch = 20
If MaxFound - (EndStart) < 20 then NextMatch = MaxFound - (EndStart)
Response.write "<A HREF=" & NextURL & ">Next " & NextMatch & " Matches</A> "
end if
%> </p>


<table BORDER="1" CELLSPACING="0" width="100%">
<font FACE="Arial" COLOR="#000000">

<caption><b>

<!-- *YOU SHOULD CHANGE THE TEXT IN THE NEXT LINE TO MATCH YOUR LOG DATABASE NAME -->


G0CUZ LOG Database - Updated 09/12/2001

</b></caption>


<THEAD>
<tr>
</font><font FACE="Arial">

<!-- *YOU CAN REMOVE ANY COMPLETE LINE OF CODE TO STOP COLUMN BEING DISPLAYED IN TABLE -->
<!-- *IMPORTANT. YOU MUST DELETE CORRESPONDING LINE OF CODE FROM POSITION MARKED BELOW -->

<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">CALLSIGN</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">DATE</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">UTC</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">MHZ</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">MODE</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">REMARKS</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">QSLIN</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">QSLOUT</font></th>
<th BGCOLOR="#000080" BORDERCOLOR="#000000"><font SIZE="2" FACE="Arial" color="#FFFFFF">PROP</font></th>

<font FACE="Arial" COLOR="#000000">
</tr>
</THEAD>
<TBODY>
<%

If not(rs.BOF = True or rs.EOF = True) then
rs.MoveFirst
rs.absoluteposition=Start
EndStart = Start + 19
End If
If EndStart > MaxFound then EndStart = MaxFound
For ZZ = Start to EndStart
if rs.eof = true then exit for

%>
<tr VALIGN="TOP">

<!-- *MAKE CORRESPONDING CHANGES HERE TO TABLE -->
<!-- *YOU CAN CHANGE VARIOUS PARAMETERS IN THIS TABLE -->
<!-- *TO SUIT YOUR REQUIREMENTS - DELETE FIELDS NOT REQUIRED IN TABLE -->
<!-- *YOU SHOULD REMOVE ANY COMPLETE LINE OF CODE TO STOP COLUMN BEING DISPLAYED IN TABLE -->

<td BORDERCOLOR="#c0c0c0" ALIGN="RIGHT"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("Callsign").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="RIGHT"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("Date").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="CENTER"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("STime").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="RIGHT"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("Band").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="CENTER"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("Mode").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="LEFT"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("Remarks").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="LEFT"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("QSLIN").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="LEFT"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("QSLOUT").Value & "")%><br></font></td>
<td BORDERCOLOR="#c0c0c0" ALIGN="LEFT"><font SIZE="2" FACE="Arial" COLOR="#000000"><%=Server.HTMLEncode(rs.Fields("PROP").Value & "")%><br></font></td>


</tr>
<%
rs.MoveNext
next

rs.close%>


<% Else %>

<tr>

<!-- *YOU SHOULD CHANGE TEXT IN NEXT LINE TO SUIT YOUR REQUIREMENTS -->

<td><strong>Welcome to the G0CUZ online Log Database. Last uploaded 28 May 2002 </strong><p>


<!-- *YOU CAN CHANGE TEXT IN THE NEXT LINES TO SUIT YOUR REQUIREMENTS -->


To search, select a field from drop down list and enter a search string into the search
box. Date should be entered in the format 'MM/DD/YYYY'   You may use the wild card character <strong>*</strong> if required, e.g.
  *, G*, etc. but not on numeric fields e.g. 'Band' <p> <strong>

This searchable log database demonstrates the possibilities using ASP and a Log Database
used by Winlog32, without modification or exporting. This Active Server Page has advanced
search capabilities compared with conventional log search engines.<p>
<center> MY THANKS TO WWW.BRINKSTER.COM FOR THE ASP FACILITY </center>

</strong>
<br>



<% End If %>

</TBODY><TFOOT></TFOOT> </td>
</tr>
</table>
</font>
</body>
</html>
G0CUZ
Site Admin
Posts: 461
Joined: Wed Jan 02, 2002 7:12 am

Active Server Page demo Online logs

Post by G0CUZ »

OK so the above code looks pretty forbidding, but you really do not need to change many parameters, if you have dabbled in html, then you should be able to cope with it.

A little further info on how to impliment it......
After signing up with Brinkster, you will be allocated web space (20MB I think - so it's enough for any log), uploading is via their on-page uploader and NOT using a FTP program - this usually works OK however.

One thing that I forgot to mention is that the example refers to a file "back32.gif" the background image - you can rob mine, delete the line of html or add your own background image.

The asp file (the code in the first posting) should go in the root and the log database should go in the /db folder that they provide you with.
You only need to make a pointer to the 'asp' page then from your web page, and you have an online log - then you need to upload your log database at regular intervals - you do not need to export or modify it in any way.

If you want to know what I worked on 6m the other day go to my online log
http://www14.brinkster.com/cuz/log.asp
and select 'Date' from the drop down list and enter 05/26/2002 into the search criteria (N.B. Dates must follow the American format MM/DD/YY).
From this you will get an idea what an ASP can offer.

I will gladly help, if and when I have time.




73 Colin G0CUZ
Winlog32 Author
User avatar
g0gfq
New user
Posts: 0
Joined: Tue Jan 08, 2002 12:09 am

Active Server Page demo Online logs

Post by g0gfq »

Hi Colin et al

Inspired by your post we have had a go and only 2 emails to you with pointers and one problem, my problem with reading the servers instructions it is working.

I just have to put a link on website etc. to get what I always wanted a searchable online log. Once again Colin, Winlog 32 comes up trumps so thanks for all the help (I didn't have to pester you too much did I?) Colin.

My Online log is at the following;

http://www23.brinkster.com/g0gfq/log.asp

It isn't right up to date as I used a backup log file, but it is only a few days out. Give it a try for yourself...

73

Keith GØGFQ
Please visit my website: www.g0gfq.com

Edited by - g0gfq on 02/06/2002 9:19:27 PM
G0CUZ
Site Admin
Posts: 461
Joined: Wed Jan 02, 2002 7:12 am

Active Server Page demo Online logs

Post by G0CUZ »


Yeah..............'Way to go' Keith.




73 Colin G0CUZ
Winlog32 Author
Post Reply