Several Response.Write issues

J

Jim T

New at FrontPage/ASP but gaining ground. I'm writing an application and am
woring on a page that retrieves data from an Access DB. I'm getting the data
fine and would like to display it in a series of tables. I've written code to
Response.Write the HTML lines for a form and the table. I designed the table
in FP2000 with the cell widths I want for the Access data field values, bold,
and color for the data cells. Likewise I set the color and other attributes
(size, italic) for the cells containing labels. (Note some cells have also
been merged).

In the table tag, I've set the width in pixels and table-layout as fixed.
The code for the table row also specifies the width in pixels.

I have code in the ASP page to retrieve the rows of fata and response.write
a table for each row (usually 2-4 rows based on the criteria) in a While
loop. This part is working fine.

Problem 1: The cells widths do not remain fixed so from one table on the
page to the next the table appearance is not consistant (i.e. each cell in
the table expands/contracts according to the lenght of the DB data filling
the cell)

Problem 2: The color attributes are not coming through. I have the labels
colored blue and the data colored red; everything however is black.

Problem 3: The table is inside a form and I would like to include a submit
button in the top left corner cell (or just below the table) so the user can
select the data in the table to jump to another ASP page that will contain
data from an associated (detail data) table relative to that record. In the
FrontPage layout I included a submit button and used the HTML line in my code
for each table written. However the resulting input
on the displayed page is not a button but an input text field.

Other: Can I use VB's Chr(34) in place to the multiple """"; if so will a
single Chr(34) do the trick?

Heres examples of lines of code I'm using:

Response.Write "<div style=""""width:1382; height:100; overflow:auto;
border:""""id=""""dataList"""">"

Response.Write "<table table-layout:""""fixed"""" border=""""1""""
width=""""1382"""" height=""""182"""">"

Response.Write "<td width=""""187"""" height=""""26""""><b><font
color=""""#FF0000"""" size=""""4"""">" & mapno & "</font></b></td>"

(note; mapno is a variable/field from the DB)

Response.Write "<p><input type=""""submit"""" value=""""Property Data""""
name=""""B1""""></p>"

Being new at this I'm sure there are better ways so any help would be
appreciated.
 
R

Ronx

I would make life a bit easier and let FrontPage construct the table
and use ASP to fill in the cells:

'Previous code
%>
<div style="width:1382px;height:100px;overflow:auto;border:none;"
id="datalist">
<table border="1" width="1382">
<td width="187" height="26"><b><font color="#ff0000"
size="4"><b><%=mapno%></font></b</td>

<p><input type="submit" value="Property Data" name="B1"></p>


Any sizes given to a table or table cell are minimums. The cell will
always expand to accommodate the data in it.
Table height is not valid HTML - browsers will either ignore the
height given, or some old browsers will use it - cutting off any data
or cells that overflow.

Incidentally, the table and div combination is designed for a browser
opened to more than 1440px wide - apart from me and some huge laptops
and tablet PCs, who has a screen capable of displaying that width
without left-right scrolling?
 
J

jimt

Thanks Ronx,
I created my table in FP and then took my ASP code and added it to the page.
My question is how do I get multiple tables on the page corresponding to the
multiple rows of data from the DB?

Currently my page layout is like:

FP HTML header lines
< Body
<%
db connection etc
while not EOF
get data and assign to variable names
end while
%>
FP Body and Table lines
</body>

This will only display one table corresponding to the last row read. If I
move the "end while and %> lines to just before the </body> tag, obviously,
I get an error message for VBScript syntax on the HTML line(s).

I have experience with VBA but new at ASP so I don't have some of the
concepts down yet.

Thanks for any addtional help you can give.
JimTinder


Ronx said:
I would make life a bit easier and let FrontPage construct the table
and use ASP to fill in the cells:

'Previous code
%>
<div style="width:1382px;height:100px;overflow:auto;border:none;"
id="datalist">
<table border="1" width="1382">
<td width="187" height="26"><b><font color="#ff0000"
size="4"><b><%=mapno%></font></b</td>

<p><input type="submit" value="Property Data" name="B1"></p>


Any sizes given to a table or table cell are minimums. The cell will
always expand to accommodate the data in it.
Table height is not valid HTML - browsers will either ignore the
height given, or some old browsers will use it - cutting off any data
or cells that overflow.

Incidentally, the table and div combination is designed for a browser
opened to more than 1440px wide - apart from me and some huge laptops
and tablet PCs, who has a screen capable of displaying that width
without left-right scrolling?
 
R

Ronx

Consider this:

<%
'db connection etc.
'assume the record set is referenced by rs
do while not rs.EOF
'assign record to variables, if required, eg varfield1=rs("field1")
%>
<table>
<tr>
<td><%=varfield1%></td> <!-- or <td><%=rs("field1")%></td> -->
<td><%=varfield2%></td> <!-- or <td><%=rs("field2")%></td> -->
</tr>
</table>
<%
rs.movenext
loop
'close database connections and set objects to nothing.
%>
</body>

--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.
FrontPage Support: http://www.frontpagemvps.com/

jimt said:
Thanks Ronx,
I created my table in FP and then took my ASP code and added it to
the page.
My question is how do I get multiple tables on the page
corresponding to the
multiple rows of data from the DB?

Currently my page layout is like:

FP HTML header lines
< Body
<%
db connection etc
while not EOF
get data and assign to variable names
end while
%>
FP Body and Table lines
</body>

This will only display one table corresponding to the last row read.
If I
move the "end while and %> lines to just before the </body> tag,
obviously,
I get an error message for VBScript syntax on the HTML line(s).

I have experience with VBA but new at ASP so I don't have some of
the
concepts down yet.

Thanks for any addtional help you can give.
JimTinder
 
J

jimt

Thanks for the great help. Your suggestion worked perfectly and I understand
a little bit more about how HTML and ASP works together.

Thanks again
Jim T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top