Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Unique table call for table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 08 August 2010 :  02:44:13  Show Profile  Reply with Quote
Currently I have been asked by my father to set him up a log book for his Ham Radio stuff and know what I want to setup using the following database fields:

LOG_ID
LOG_MONTH_YEAR
LOG_CALLSIGN
LOG_YES_NO
LOG_SMILE
LOG_DATE



-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Unique (LOG_MONTH_YEAR) | Unique (LOG_MONTH_YEAR) | Unique (LOG_MONTH_YEAR) |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Unique (LOG_MONTH_YEAR) | Unique (LOG_MONTH_YEAR) | Unique (LOG_MONTH_YEAR) |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Unique (LOG_MONTH_YEAR) | Unique (LOG_MONTH_YEAR) | Unique (LOG_MONTH_YEAR) |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
| Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) | Data (LOG_CALLSIGN) Y/N (LOG_YES_NO) If Smile (LOG_SMILE) |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


I have it grouping the items with the LOG_MONTH_YEAR from the database, but need to have only the 3 columns going across. Here is my code I have:

 <br />
<%
'Dimension variables
Dim rsVK3PALog		'Holds the recordset for the records in the database

'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

%>
<!--#INCLUDE VIRTUAL="/connection.asp" -->
<%

Response.Write ("<table width=""200"" border=""0"" cellpadding=""0"" cellspacing=""0"">")

'Create an ADO recordset object
Set rsVK3PALog = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT VK3PA_LOG.* FROM VK3PA_LOG ORDER BY LOG_MONTH_YEAR, LOG_ID ASC;"

'Open the recordset with the SQL query 
rsVK3PALog.Open strSQL, adoCon

Do While NOT rsVK3PALog.EOF
  strMonthLog = rsVK3PALog("LOG_MONTH_YEAR")
  strLogCounter = strLogCounter + 0

	if strMonthLog <> tmpDayOfWeek And strLogCounter <> 1 then
		Response.Write ("	<tr>")
		Response.Write ("		<td width=""200"" colspan=""4"" align=""left"">")
		Response.Write ("			 <br />")
		Response.Write ("		</td>")
		Response.Write ("	</tr>")
		Response.Write ("	<tr>")
		Response.Write ("		<td width=""200"" colspan=""4"" align=""center"">")
		Response.Write ("			<font class=""logs_header"">" & strMonthLog &"</font>")
		Response.Write ("		</td>")
		Response.Write ("	</tr>")
	end if

	Response.Write ("	<tr>")
	Response.Write ("		<td width=""10"" align=""left"">")
	Response.Write ("			<font class=""text3f""> </font>")
	Response.Write ("		</td>")
	Response.Write ("		<td width=""140"" align=""left"">")
	Response.Write ("			<font class=""text3f"">" & rsVK3PALog("LOG_CALLSIGN") & "</font>")
	Response.Write ("		</td>")
	Response.Write ("		<td width=""20"" align=""left"">")
	Response.Write ("			<font class=""text3f"">" & rsVK3PALog("LOG_YES_NO") & "</font>")
	Response.Write ("		</td>")
	Response.Write ("		<td width=""30"" align=""middle"" valign=""center"">")
	Response.Write ("			<font class=""text3f""><img src=""" & strSiteURL & "/forum/forum_images/icon_smile.gif"" width=""15"" height=""15""> </font>")
	Response.Write ("		</td>")
	Response.Write ("	</tr>")
	startrw = startrw + 1
		
	tmpDayOfWeek = strMonthLog
	rsVK3PALog.MoveNext

loop

Response.Write ("</table>")
'Reset server objects
rsVK3PALog.Close
Set rsVK3PALog = Nothing
Set adoCon = Nothing
%>


Is anyone able to help with having the unique tables have 3 columns before writing the next lot of 3 below them?

Cheers,

David Greening

Carefree
Advanced Member

Philippines
4224 Posts

Posted - 08 August 2010 :  05:38:25  Show Profile  Reply with Quote
So you want them in groups of five rows, those three columns? Sure, no problem. Change line 28 to say:

	if (strMonthLog <> tmpDayOfWeek And strLogCounter <> 1) or (startrw/5 = int(startrw/5)) then

Edited by - Carefree on 08 August 2010 05:42:12
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 08 August 2010 :  06:08:46  Show Profile  Reply with Quote
Trying for something like this:



There are a number of different entries for each month and need to include them in each month.

Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4224 Posts

Posted - 08 August 2010 :  08:05:34  Show Profile  Reply with Quote
OK - Give this a go.


<%
'Dimension variables
Dim rsVK3PALog		'Holds the recordset for the records in the database

'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

%>
<!--#INCLUDE VIRTUAL="/connection.asp" -->
<%

Response.Write ("<table width=""200"" border=""0"" cellpadding=""0"" cellspacing=""0"">")

'Create an ADO recordset object
Set rsVK3PALog = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT VK3PA_LOG.* FROM VK3PA_LOG ORDER BY LOG_MONTH_YEAR, LOG_ID ASC;"

'Open the recordset with the SQL query 
rsVK3PALog.Open strSQL, adoCon

if not rsVK3PALOG.EOF then
	rsVK3PALOG.MoveFirst
	intCounter=1
	Do While NOT rsVK3PALog.EOF
  	strMonthLog = rsVK3PALog("LOG_MONTH_YEAR")
	  strLogCounter = strLogCounter + 0
		if intCounter/3=int(intCounter/3) then
			Response.Write ("	<tr>")
			Response.Write ("		<td width=""200"" colspan=""4"" align=""left"">")
			Response.Write ("			 <br />")
			Response.Write ("		</td>")
			Response.Write ("	</tr>")
			Response.Write ("	<tr>")
			Response.Write ("		<td width=""200"" colspan=""4"" align=""center"">")
			Response.Write ("			<font class=""logs_header"">" & strMonthLog &"</font>")
			Response.Write ("		</td>")
			Response.Write ("	</tr>")
		end if
		Response.Write ("	<tr>")
		Response.Write ("		<td width=""10"" align=""left"">")
		Response.Write ("			<font class=""text3f""> </font>")
		Response.Write ("		</td>")
		Response.Write ("		<td width=""140"" align=""left"">")
		Response.Write ("			<font class=""text3f"">" & rsVK3PALog("LOG_CALLSIGN") & "</font>")
		Response.Write ("		</td>")
		Response.Write ("		<td width=""20"" align=""left"">")
		Response.Write ("			<font class=""text3f"">" & rsVK3PALog("LOG_YES_NO") & "</font>")
		Response.Write ("		</td>")
		Response.Write ("		<td width=""30"" align=""middle"" valign=""center"">")
		Response.Write ("			<font class=""text3f""><img src=""" & strSiteURL & "/forum/forum_images/icon_smile.gif"" width=""15"" height=""15""> </font>")
		Response.Write ("		</td>")
		Response.Write ("	</tr>")
		startrw = startrw + 1
		if tmpDayofWeek <> strMonthLog then intCounter=intCounter+1
		tmpDayOfWeek = strMonthLog
		rsVK3PALog.MoveNext
	loop
	rsVK3PALog.Close
end if
Response.Write ("</table>")
'Reset server objects
Set rsVK3PALog = Nothing
Set adoCon = Nothing
%>
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 09 August 2010 :  04:45:00  Show Profile  Reply with Quote
Tried it and the code did not work. Showed the items all in the 1 column and only showing 3 items per date range and mixed over the place. Good try but.. I will work on it further to try and get it working later in the week.

Cheers,

David Greening
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 09 August 2010 :  10:21:57  Show Profile  Reply with Quote
I have something similar but I use getrows to get the record set. So I might have something in the wrong place. But it looks right to me. Just a matter of opening and closing the tags in the right place :}
<br />
<%
'Dimension variables
Dim rsVK3PALog 'Holds the recordset for the records in the database

'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

%>
<!--#INCLUDE VIRTUAL="/connection.asp" -->
<%
'made table wider to hold 3 cells
Response.Write ("<table width=""600px"" border=""0"" cellpadding=""0"" cellspacing=""0"">")

'Create an ADO recordset object
Set rsVK3PALog = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT VK3PA_LOG.* FROM VK3PA_LOG ORDER BY LOG_MONTH_YEAR, LOG_ID ASC;"

'Open the recordset with the SQL query
rsVK3PALog.Open strSQL, adoCon


if not rsVK3PALog.EOF then
'Give variables an initial value

Dim intCols: intCols = 3 'number of columns
Dim intColPnt: intColPnt = 1 'column pointer
Dim strLastMonthLog: strLastMonthLog = "dummy" 'last month
Dim strColWidth

select case intCols
case 1
strColWidth = "100%"
case 2
strColWidth = "50%"
case 3
strColWidth = "33%"
case 4
strColWidth = "25%"
case 5
strColWidth = "20%"
case 6
strColWidth = "16.5%"
end select

Do While NOT rsVK3PALog.EOF
strMonthLog = rsVK3PALog("LOG_MONTH_YEAR")

'close month cell if needed
if strLastMonthLog <> "dummy" then
if strMonthLog <> strLastMonthLog then
Response.Write (" </table></td>")
end if
end if


'reset column counter to 1 and close row if needed
if intColPnt > intCols then
intColPnt = 1
Response.Write (" </tr>")
end if

'start a new row if needed
if intColPnt = 1 then
Response.Write (" <tr>")
end if

'start a new month cell if needed
if strMonthLog <> strLastMonthLog then
Response.Write (" <td width=""" & intColWidth & """>")
Response.Write (" <table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">")
Response.Write (" <tr>")
Response.Write (" <td colspan=""4"" align=""left"">")
Response.Write (" <br />")
Response.Write (" </td>")
Response.Write (" </tr>")
Response.Write (" <tr>")
Response.Write (" <td colspan=""4"" align=""center"">")
Response.Write (" <font class=""logs_header"">" & strMonthLog &"</font>")
Response.Write (" </td>")
Response.Write (" </tr>")
end if

' log data
Response.Write (" <tr>")
Response.Write (" <td width=""10"" align=""left"">")
Response.Write (" <font class=""text3f""> </font>")
Response.Write (" </td>")
Response.Write (" <td width=""140"" align=""left"">")
Response.Write (" <font class=""text3f"">" & rsVK3PALog("LOG_CALLSIGN") & "</font>")
Response.Write (" </td>")
Response.Write (" <td width=""20"" align=""left"">")
Response.Write (" <font class=""text3f"">" & rsVK3PALog("LOG_YES_NO") & "</font>")
Response.Write (" </td>")
Response.Write (" <td width=""30"" align=""middle"" valign=""center"">")
Response.Write (" <font class=""text3f""><img src=""" & strSiteURL & "/forum/forum_images/icon_smile.gif"" width=""15"" height=""15""> </font>")
Response.Write (" </td>")
Response.Write (" </tr>")

'move column pounter
intColPnt = intColPnt + 1

'refresh last month
strLastMonthLog = strMonthLog

rsVK3PALog.MoveNext

Loop

'close up last cell and row
Response.Write (" </table></td>")
Response.Write (" </tr>")
else
Response.Write ("<tr><td align=""center""><font class=""logs_header"">"No Logs Found</font></td></tr>")
end if

Response.Write ("</table>")
'Reset server objects
rsVK3PALog.Close
Set rsVK3PALog = Nothing
Set adoCon = Nothing
%>

    _-/Cripto9t\-_
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 10 August 2010 :  04:01:52  Show Profile  Reply with Quote
http://www.google.com/search?q=ham+radio+logging+software&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

Carefree
Advanced Member

Philippines
4224 Posts

Posted - 10 August 2010 :  04:43:22  Show Profile  Reply with Quote
I'll have to create a database and actually try this, David. I'll have it done today sometime.
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 12 August 2010 :  06:20:22  Show Profile  Reply with Quote
Anyone got any ideas as the tables are not quite going the way that I need them? Many thanks in advance...


Cheers,

David Greening
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 28 August 2010 :  23:36:09  Show Profile  Reply with Quote
I am still having issues with this if anyone has an idea on how to do it would be fantastic. I have it not showing the 3 columns across but it randomly puts coloums be it 3 or 1, but very random.


Cheers,

David Greening
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 10 September 2010 :  20:57:46  Show Profile  Reply with Quote
I ended up getting this working the way my father needed... Thanks for the input.

Cheers,

David Greening
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07