Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Unique table call for table

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Classicmotorcycling Posted - 08 August 2010 : 02:44:13
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?
10   L A T E S T    R E P L I E S    (Newest First)
Classicmotorcycling Posted - 10 September 2010 : 20:57:46
I ended up getting this working the way my father needed... Thanks for the input.
Classicmotorcycling Posted - 28 August 2010 : 23:36:09
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.

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

Carefree Posted - 10 August 2010 : 04:43:22
I'll have to create a database and actually try this, David. I'll have it done today sometime.
Doug G Posted - 10 August 2010 : 04:01:52
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
cripto9t Posted - 09 August 2010 : 10:21:57
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
%>
Classicmotorcycling Posted - 09 August 2010 : 04:45:00
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.
Carefree Posted - 08 August 2010 : 08:05:34
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
%>
Classicmotorcycling Posted - 08 August 2010 : 06:08:46
Trying for something like this:



There are a number of different entries for each month and need to include them in each month.
Carefree Posted - 08 August 2010 : 05:38:25
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

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07