|
| |
Newbie needs help getting database results to go horizontal
View related threads:
(in this forum
| in all forums)
|
Logged in as: Guest
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
Newbie needs help getting database results to go horizo... - 1/28/2007 1:19:44
Hello from a newbie requesting help. I have an MS Access 2003 database which I am pulling information from. If you go to this address: http://www.ccdump.org/uniformdisplay.asp?UniformSeries=ENT you can see the database results I have. I want to sort the database by [UniformPicture] (easy enough) but I want each of the cells: <<UniformPicture>> <<UniformDescription>> to be displayed in order horizontally. If anyone has suggestions, I sure would appreciate it.
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/28/2007 16:03:05
you need to post the asp code so we can see it. sounds like you arent looping
_____________________________
Dan
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/29/2007 0:18:24
Here is the code for the entire page: -------------------------------------------------- <html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>The Computer Core Dump - </title>
</head>
<body text="#FFFF00" bgcolor="#000000">
<div align="left">
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-columntypes="3,202,202,202,202,202" s-dataconnection="Database1" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="ID" s-menuvalue="ID" b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Uniforms" s-displaycolumns="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-criteria="[UniformSeries] EQ {UniformSeries} +" s-order s-sql="SELECT * FROM Uniforms WHERE (UniformSeries = '::UniformSeries::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="UniformSeries=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="5" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a Database Results region.</font></td></tr>" startspan b-UseDotNET="FALSE" CurrentExt sa-InputTypes="202" b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes="202" b-WasTableFormat="TRUE" b-ReplaceDatabaseRegion="FALSE" --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Uniforms WHERE (UniformSeries = '::UniformSeries::')"
fp_sDefault="UniformSeries="
fp_sNoRecords="<tr><td colspan=6 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Database1"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="ID"
fp_sMenuValue="ID"
fp_sColTypes="&ID=3&UniformName=202&UniformSeries=202&UniformTitle=202&UniformPicture=202&UniformDescription=202&"
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="35469" --><%
count = count + 1
If count = 1 Then
%>
<tr>
<%
End If
%>
<td> <%
count = count + 1
If count = 1 Then
%>
<tr>
<%
End If
%>
<td> <table border="1" cellpadding="0" cellspacing="0" width="130" id="table1" height="300">
<tr>
<td height="270">
<p align="center">
<img border="0" src="images/<%=FP_FieldVal(fp_rs,"UniformPicture")%>"></td>
</tr>
<tr>
<td valign="top">
<p align="center"><font size="1" face="Arial">
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-column="UniformDescription" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>UniformDescription<font size="-1">>></font>" startspan s-ColumnTypes="3,202,202,202,202,202" --><%=FP_FieldVal(fp_rs,"UniformDescription")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="58233" --></font></td>
</tr>
</table>
<p> </td>
<%
If count = 5 Then
count = 5
%>
</tr>
<%
End If
%> </td>
<%
If count = 5 Then
count = 5
%>
</tr>
<%
End If
%>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="5" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr><TR><TD VALIGN=MIDDLE COLSPAN=64><NOBR><INPUT TYPE=Button VALUE=" |< "><INPUT TYPE=Button VALUE=" < "><INPUT TYPE=Button VALUE=" > "><INPUT TYPE=Button VALUE=" >| "> [1/5]</NOBR><BR></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --><%If count <> 0 Then Response.Write "</tr>"%>
</tbody>
</table>
</div>
<p> </p>
<table>
<tr></td>
<%
If count = 5 Then
count = 5
%>
</tr>
<%
End If
%> </td>
<%
If count = 5 Then
count = 5
%>
</tr>
<%
End If
%>
</table>
</body>
</html>
< Message edited by rdouglass -- 1/29/2007 8:48:30 >
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/29/2007 13:27:25
I have seen this page. How would you change the above code to get it to loop or fit into specific columns?
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/29/2007 14:48:35
quote:
<% If count = 5 Then count = 5 %> </tr> <% End If %> </td> <% If count = 5 Then count = 5 %> </tr> <% End If %> That stuff looks like it's doubled. Same with the above one that starts the row(<tr>). I think they may need to be single. I have not fully diagnosed your page but that looks like an issue to me. Also, you need to reset count back to 0 on the last one I think. You're never resetting count to get it to equal 1 to start your next row. That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/29/2007 15:03:58
So the last one should be: If count = 0 Then count = 0 I will try that. Thanks for any additional suggestions.
< Message edited by vmo1701 -- 1/29/2007 15:11:12 >
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/29/2007 16:19:16
quote:
If count = 0 Then count = 0 Not quite. It should be: ... IF count = 5 THEN count = 0 ... I believe your logic is the same as mine. When we get 5 items we want to start another row correct? So if we are checking for count to equal 0, it *never* will 'cause we always add 1 to it on the first line. ANsd if we check for 5 and then set it also to 5, it will never get back to 1 to start the new row next time we recurse the loop. Does that make any sense?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/29/2007 16:29:25
I tried changing the code, but it still won't go to the next row. I tried bring out all of the records, but it won't work.
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/30/2007 5:59:33
any additional suggestions? or changes to the code I'm missing?
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/30/2007 9:39:02
Can you post what you have right now with any changes?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/31/2007 1:20:31
Here ya go. Sorry about the late response. ---------------------------------------------------------- <html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_LCID = 1033 %>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>The Computer Core Dump - Uniform Display </title>
</head>
<body text="#FFFF00" bgcolor="#000000">
<div align="left">
<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-columntypes="3,202,202,202,202,202" s-dataconnection="Database1" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice="ID" s-menuvalue="ID" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="FALSE" b-listseparator="FALSE" i-listformat="0" b-makeform="FALSE" s-recordsource="Uniforms" s-displaycolumns="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-criteria="[UniformSeries] EQ {UniformSeries} +" s-order s-sql="SELECT * FROM Uniforms WHERE (UniformSeries = '::UniformSeries::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="UniformSeries=" s-norecordsfound="No records returned." i-maxrecords="1" i-groupsize="0" botid="1" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the start of a Database Results region.</font></td></tr></table>" b-UseDotNET="FALSE" CurrentExt sa-InputTypes="202" b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes="202" b-WasTableFormat="FALSE" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Uniforms WHERE (UniformSeries = '::UniformSeries::')"
fp_sDefault="UniformSeries="
fp_sNoRecords="No records returned."
fp_sDataConn="Database1"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="ID"
fp_sMenuValue="ID"
fp_sColTypes="&ID=3&UniformName=202&UniformSeries=202&UniformTitle=202&UniformPicture=202&UniformDescription=202&"
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="30451" --><p>
<img border="0" src="images/<%=FP_FieldVal(fp_rs,"UniformName")%>"></p>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the end of a Database Results region.</font></td></tr></table>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --><p> </p>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-columntypes="3,202,202,202,202,202" s-dataconnection="Database1" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="ID" s-menuvalue="ID" b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Uniforms" s-displaycolumns="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-criteria="[UniformSeries] EQ {UniformSeries} +" s-order s-sql="SELECT * FROM Uniforms WHERE (UniformSeries = '::UniformSeries::')" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="UniformSeries=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a Database Results region.</font></td></tr>" startspan b-UseDotNET="FALSE" CurrentExt sa-InputTypes="202" b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes="202" b-WasTableFormat="TRUE" b-ReplaceDatabaseRegion="FALSE" --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Uniforms WHERE (UniformSeries = '::UniformSeries::')"
fp_sDefault="UniformSeries="
fp_sNoRecords="<tr><td colspan=6 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Database1"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="ID"
fp_sMenuValue="ID"
fp_sColTypes="&ID=3&UniformName=202&UniformSeries=202&UniformTitle=202&UniformPicture=202&UniformDescription=202&"
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="34829" --><%
count = count + 1
If count = 1 Then
%>
<tr>
<%
End If
%>
<td> <%
count = count + 1
If count = 1 Then
%>
<tr>
<%
End If
%>
<td> <table border="1" cellpadding="0" cellspacing="0" width="130" id="table1" height="300">
<tr>
<td height="270">
<p align="center">
<img border="0" src="images/<%=FP_FieldVal(fp_rs,"UniformPicture")%>"></td>
</tr>
<tr>
<td valign="top">
<p align="center"><font size="1" face="Arial">
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-column="UniformDescription" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>UniformDescription<font size="-1">>></font>" startspan s-ColumnTypes="3,202,202,202,202,202" --><%=FP_FieldVal(fp_rs,"UniformDescription")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="58233" --></font></td>
</tr>
</table>
<p> </td>
<%
If count = 5 Then
count = 5
%>
</tr>
<%
End If
%>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --><%If count <> 0 Then Response.Write "</tr>"%>
</tbody>
</table>
</div>
<p> </p>
<table>
<tr></td>
<%
If count = 5 Then
count = 0
%>
</tr>
<%
End If
%>
</table>
</body>
</html>
< Message edited by rdouglass -- 1/31/2007 8:43:10 >
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/31/2007 8:52:26
quote:
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="34829" --><% count = count + 1 If count = 1 Then %> <tr> <% End If %> <td> <% count = count + 1 If count = 1 Then %> <tr> <% End If %> <td> <table border="1" cellpadding="0" cellspacing="0" width="130" id="table1" height="300"> <tr> <td height="270"> <p align="center"> <img border="0" src="images/<%=FP_FieldVal(fp_rs,"UniformPicture")%>"></td> </tr> <tr> <td valign="top"> <p align="center"><font size="1" face="Arial"> <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,UniformName,UniformSeries,UniformTitle,UniformPicture,UniformDescription" s-column="UniformDescription" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>UniformDescription<font size="-1">>></font>" startspan s-ColumnTypes="3,202,202,202,202,202" --><%=FP_FieldVal(fp_rs,"UniformDescription")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="58233" --></font></td> </tr> </table> <p> </td> <% If count = 5 Then count = 5 %> </tr> <% End If %> Try it like this: ... <!--webbot bot="DatabaseRegionStart" endspan i-checksum="34829" --><% count = count + 1 If count = 1 Then %> <tr> <% End If %> <td> <table border="1" cellpadding="0" cellspacing="0" width="130" id="table1" height="300"> <tr> <td height="270"> <p align="center"> <img border="0" src="images/<%=FP_FieldVal(fp_rs,"UniformPicture")%>"></td> </tr> <tr> <td valign="top"> <p align="center"><font size="1" face="Arial"> <%=FP_FieldVal(fp_rs,"UniformDescription")%></font><p> </td> </tr> </table> </td> <% If count = 5 Then count = 0 %> </tr> <% End If %> Look very closely at this code and you should see the differences. Hope it helps.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 1/31/2007 12:42:37
That did it! I am SO grateful. Thanks alot!
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 2/2/2007 18:31:42
Quick question: Is there a simple way to make this go down 5 rows, then start a new column. Basically, I just wanna know if there's an easy way to make a horizontal scroll into a vertical scroll. Ex: _______________ | text 1 | text 6 | | text 2 | text 7 | | text 3 | text 8 | | text 4 | text 9 | | text 5 | text 10|
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Newbie needs help getting database results to go ho... - 2/2/2007 21:56:52
quote:
Is there a simple way to make this go down 5 rows, then start a new column. Simple, no - not at all. I have a script that I use that does that for 3 columns but it is absolutely not for the weak-at-heart. And there is no way I'd attempt it with the DRW - i'ts just too much work. I dump he data into arrays and loop thru the array using a count of "ubound(array,2) MOD 3" for the number of times thru the loop and the most difficult part (for me anyways) was determinig the last row. However, if you're interested, I'll post what I use for the 3 column one. If you're not comfortable with ASP, arrays, and stuff, it would probably be a job to tackle it. But if you can follow it and the theory, you should be able to make it do 5 columns.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
vmo1701
Posts: 11 Joined: 1/28/2007 Status: offline
|
RE: Newbie needs help getting database results to go ho... - 2/2/2007 22:05:23
Thanks rdouglass. Let me take a look at the code. I may be a newbie at this coding stuff, but I am a reasonably logical person.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|