473,395 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Arrays / Tables / Anything for a "clean" display

Somebody take a look and give me any suggestions? My brain is nuked...

Here's my deal....I have online submission forms on my intranet at
work here....I am appending to an Access DB with the input from all
HTML fields and then querying aforementioned DB with different
variables (search by name, wave, reason, etc). The output that I'm
getting (SELECT * 'cause I need all of the data included in the
search) I would like to display in a nice table or array but I'm not
quite sure how to make those settings "dynamic", for lack of a better
word. What I mean is, the form is used at various times throughout the
day so I don't want to put a cap on the array rows and columns since
they will be constantly increasing. Any suggestions?

Here's the code I have right now (I was playing around with display
ideas) and the table is the basic way I want it but the columns change
to fit whatever data is in them....That's not good, I want a RIGID
column that will be unwavering in it's data display...

Throw me a bone here...Thanks guys...

<%

Mode = request.form("mode")
Name = request.form("name")
Shift = request.form("shift")
Wave = request.form("wave")
Carton = request.form("carton")
Location = request.form("location")
License = request.form("license")
Sku = request.form("sku")
Qty = request.form("quantity")
Reason = request.form("reason")
Comments = request.form("comments")

'************************************************* ****************************
'* DATABASE APPENDING
*
'************************************************* ****************************
'create db connection
Set dbconn = Server.CreateObject("ADODB.Connection")

'open db in a DSN-less method
dbconn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&
Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage_test.mdb")

'sql statement to return input values drawn from html fields
SQLqry = "SELECT * from test_data WHERE name LIKE '%%"&name&"%%'"

'display results of statement on screen for testing purposes
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

'remind db who it works for
Set rs = dbconn.Execute(SQLqry)

While Not rs.EOF
Response.Write "<table border='1'>"
Response.Write "<tr><td><b>Name:</b> " & rs("name")
Response.Write "<td>"
Response.Write "<b>Days/Nights:</b> " & rs("shift")
Response.Write "<td>"
Response.Write "<b>Wave Number:</b> " & rs("wave")
Response.Write "<td>"
Response.Write "<b>Carton Number:</b> " & rs("carton")
Response.Write "<td>"
Response.Write "<b>Location:</b> " & rs("location")
Response.Write "<td>"
Response.Write "<b>License:</b> " & rs("license")
Response.Write "<td>"
Response.Write "<b>SKU:</b> " & rs("sku")
Response.Write "<td>"
Response.Write "<b>Quantity:</b> " & rs("qty")
Response.Write "<td>"
Response.Write "<b>Reason:</b> " & rs("reason")
Response.Write "<td>"
Response.Write "<b>Comments:</b> " & rs("comments")
Response.Write "<td>"
Response.Write "<b>Date Submitted:</b> " & rs("date")
Response.Write "</td></table>"
rs.MoveNext
Wend

'smack around the db connection until it lets go
dbconn.Close

'terminate db connection with extreme prejudice
set dbconn = nothing

%>
Jul 19 '05 #1
4 1781
If I understand you correctly you want the table data to be listed in a
consistent manner... this is actually an HTML problem, where what you're
doing is creating a new table for each row (also, you forget to close your
TDs and your TR), but anyway, here goes (also, you could include width= in
your TDs):

Response.Write "<table border='1'>"

While Not rs.EOF
Response.Write "<tr><td><b>Name:</b> " & rs("name") & "</td>"
Response.Write "<td>"
Response.Write "<b>Days/Nights:</b> " & rs("shift") & "</td>"
Response.Write "<td>"
Response.Write "<b>Wave Number:</b> " & rs("wave") & "</td>"
Response.Write "<td>"
Response.Write "<b>Carton Number:</b> " & rs("carton") & "</td>"
Response.Write "<td>"
Response.Write "<b>Location:</b> " & rs("location") & "</td>"
Response.Write "<td>"
Response.Write "<b>License:</b> " & rs("license") & "</td>"
Response.Write "<td>"
Response.Write "<b>SKU:</b> " & rs("sku") & "</td>"
Response.Write "<td>"
Response.Write "<b>Quantity:</b> " & rs("qty") & "</td>"
Response.Write "<td>"
Response.Write "<b>Reason:</b> " & rs("reason") & "</td>"
Response.Write "<td>"
Response.Write "<b>Comments:</b> " & rs("comments") & "</td>"
Response.Write "<td>"
Response.Write "<b>Date Submitted:</b> " & rs("date") & "</td>"
Response.Write "</tr>"
rs.MoveNext
Wend

Response.Write "</table>"
--
Yours sincerely,
Jacob Munk-Stander | http://jacob.munk-stander.dk
"dmiller23462" <dm**********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
Somebody take a look and give me any suggestions? My brain is nuked...

Here's my deal....I have online submission forms on my intranet at
work here....I am appending to an Access DB with the input from all
HTML fields and then querying aforementioned DB with different
variables (search by name, wave, reason, etc). The output that I'm
getting (SELECT * 'cause I need all of the data included in the
search) I would like to display in a nice table or array but I'm not
quite sure how to make those settings "dynamic", for lack of a better
word. What I mean is, the form is used at various times throughout the
day so I don't want to put a cap on the array rows and columns since
they will be constantly increasing. Any suggestions?

Here's the code I have right now (I was playing around with display
ideas) and the table is the basic way I want it but the columns change
to fit whatever data is in them....That's not good, I want a RIGID
column that will be unwavering in it's data display...

Throw me a bone here...Thanks guys...

<%

Mode = request.form("mode")
Name = request.form("name")
Shift = request.form("shift")
Wave = request.form("wave")
Carton = request.form("carton")
Location = request.form("location")
License = request.form("license")
Sku = request.form("sku")
Qty = request.form("quantity")
Reason = request.form("reason")
Comments = request.form("comments")

'************************************************* **************************
** '* DATABASE APPENDING
*
'************************************************* **************************
** 'create db connection
Set dbconn = Server.CreateObject("ADODB.Connection")

'open db in a DSN-less method
dbconn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&
Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage_
test.mdb")
'sql statement to return input values drawn from html fields
SQLqry = "SELECT * from test_data WHERE name LIKE '%%"&name&"%%'"

'display results of statement on screen for testing purposes
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

'remind db who it works for
Set rs = dbconn.Execute(SQLqry)

While Not rs.EOF
Response.Write "<table border='1'>"
Response.Write "<tr><td><b>Name:</b> " & rs("name")
Response.Write "<td>"
Response.Write "<b>Days/Nights:</b> " & rs("shift")
Response.Write "<td>"
Response.Write "<b>Wave Number:</b> " & rs("wave")
Response.Write "<td>"
Response.Write "<b>Carton Number:</b> " & rs("carton")
Response.Write "<td>"
Response.Write "<b>Location:</b> " & rs("location")
Response.Write "<td>"
Response.Write "<b>License:</b> " & rs("license")
Response.Write "<td>"
Response.Write "<b>SKU:</b> " & rs("sku")
Response.Write "<td>"
Response.Write "<b>Quantity:</b> " & rs("qty")
Response.Write "<td>"
Response.Write "<b>Reason:</b> " & rs("reason")
Response.Write "<td>"
Response.Write "<b>Comments:</b> " & rs("comments")
Response.Write "<td>"
Response.Write "<b>Date Submitted:</b> " & rs("date")
Response.Write "</td></table>"
rs.MoveNext
Wend

'smack around the db connection until it lets go
dbconn.Close

'terminate db connection with extreme prejudice
set dbconn = nothing

%>

Jul 19 '05 #2
dmiller23462 wrote:
Somebody take a look and give me any suggestions? My brain is nuked...

Here's my deal....I have online submission forms on my intranet at
work here....I am appending to an Access DB with the input from all
HTML fields and then querying aforementioned DB with different
variables (search by name, wave, reason, etc). The output that I'm
getting (SELECT * 'cause I need all of the data included in the
search)
http://www.aspfaq.com/show.asp?id=2096

I would like to display in a nice table or array but I'm not
quite sure how to make those settings "dynamic", for lack of a better
word. What I mean is, the form is used at various times throughout the
day so I don't want to put a cap on the array rows and columns since
they will be constantly increasing. Any suggestions?

http://www.aspfaq.com/show.asp?id=2467
Here's the code I have right now (I was playing around with display
ideas) and the table is the basic way I want it but the columns change
to fit whatever data is in them....That's not good, I want a RIGID
column that will be unwavering in it's data display...
Use the Style attribute:

Response.Write "<tr><td style=""width:50px""">..."

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #3
Why not try GetRows ? :-
<%
Result = DisplayTableContents("test_Data","Name",Request("N ame"))

Private Function DisplayTableContents(byVal TableName, byVal Comparator,
byVal Comparison)
MyConnection = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage_
test.mdb")

Set dbconn = Server.CreateObject("ADODB.Connection")
dbconn.Open MyConnection
SQLqry = "SELECT * from " & TableName & " WHERE " & Comparator & " LIKE
'%%" & Comparison & "%%'"
Set rs = dbconn.Execute(SQLqry)

DataArray = rs.GetRows
NumberofRecords = ubound(DataArray,2)
NumberOfFields = ubound(DataArray,1)
Redim FieldNames(NumberOfFields+1)
For FieldNumber = 0 to NumberOfFields
FieldNames(FieldNumber)= rs.Fields(FieldNumber).Name
Next
rs.close
set rs=nothing
dbconn.close
set dbconn = Nothing

Response.write("Number of Records = " & NumberOfRecords)
Response.write("Number of Fields = " & NumberOfFields)

For RecordNumber = 0 to NumberOfRecords
Response.Write "<table border='1'><tr>"
For FieldNumber = 0 To NumberOfFields
Response.Write "<td><b>" & Trim(FieldNames(FieldNumber)) & ":</b> "
Response.write DataArray(FieldNumber, RecordNumber) & "</td>"
Next
Response.Write "</tr></table>"
Next
End Function
%>

"dmiller23462" <dm**********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
Somebody take a look and give me any suggestions? My brain is nuked...

Here's my deal....I have online submission forms on my intranet at
work here....I am appending to an Access DB with the input from all
HTML fields and then querying aforementioned DB with different
variables (search by name, wave, reason, etc). The output that I'm
getting (SELECT * 'cause I need all of the data included in the
search) I would like to display in a nice table or array but I'm not
quite sure how to make those settings "dynamic", for lack of a better
word. What I mean is, the form is used at various times throughout the
day so I don't want to put a cap on the array rows and columns since
they will be constantly increasing. Any suggestions?

Here's the code I have right now (I was playing around with display
ideas) and the table is the basic way I want it but the columns change
to fit whatever data is in them....That's not good, I want a RIGID
column that will be unwavering in it's data display...

Throw me a bone here...Thanks guys...

<%

Mode = request.form("mode")
Name = request.form("name")
Shift = request.form("shift")
Wave = request.form("wave")
Carton = request.form("carton")
Location = request.form("location")
License = request.form("license")
Sku = request.form("sku")
Qty = request.form("quantity")
Reason = request.form("reason")
Comments = request.form("comments")

'************************************************* **************************
** '* DATABASE APPENDING
*
'************************************************* **************************
** 'create db connection
Set dbconn = Server.CreateObject("ADODB.Connection")

'open db in a DSN-less method
dbconn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&
Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage_
test.mdb")
'sql statement to return input values drawn from html fields
SQLqry = "SELECT * from test_data WHERE name LIKE '%%"&name&"%%'"

'display results of statement on screen for testing purposes
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

'remind db who it works for
Set rs = dbconn.Execute(SQLqry)

While Not rs.EOF
Response.Write "<table border='1'>"
Response.Write "<tr><td><b>Name:</b> " & rs("name")
Response.Write "<td>"
Response.Write "<b>Days/Nights:</b> " & rs("shift")
Response.Write "<td>"
Response.Write "<b>Wave Number:</b> " & rs("wave")
Response.Write "<td>"
Response.Write "<b>Carton Number:</b> " & rs("carton")
Response.Write "<td>"
Response.Write "<b>Location:</b> " & rs("location")
Response.Write "<td>"
Response.Write "<b>License:</b> " & rs("license")
Response.Write "<td>"
Response.Write "<b>SKU:</b> " & rs("sku")
Response.Write "<td>"
Response.Write "<b>Quantity:</b> " & rs("qty")
Response.Write "<td>"
Response.Write "<b>Reason:</b> " & rs("reason")
Response.Write "<td>"
Response.Write "<b>Comments:</b> " & rs("comments")
Response.Write "<td>"
Response.Write "<b>Date Submitted:</b> " & rs("date")
Response.Write "</td></table>"
rs.MoveNext
Wend

'smack around the db connection until it lets go
dbconn.Close

'terminate db connection with extreme prejudice
set dbconn = nothing

%>

Jul 19 '05 #4
Thanks alot for the help....Just glad I could get posted before I left
work for the weekend....I'll give all those ideas a shot and let y'all
know....Thanks again....

"Gary Jones" <ga**@vegasolutions.co.uk> wrote in message news:<uu**************@tk2msftngp13.phx.gbl>...
Why not try GetRows ? :-
<%
Result = DisplayTableContents("test_Data","Name",Request("N ame"))

Private Function DisplayTableContents(byVal TableName, byVal Comparator,
byVal Comparison)
MyConnection = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage_
test.mdb")

Set dbconn = Server.CreateObject("ADODB.Connection")
dbconn.Open MyConnection
SQLqry = "SELECT * from " & TableName & " WHERE " & Comparator & " LIKE
'%%" & Comparison & "%%'"
Set rs = dbconn.Execute(SQLqry)

DataArray = rs.GetRows
NumberofRecords = ubound(DataArray,2)
NumberOfFields = ubound(DataArray,1)
Redim FieldNames(NumberOfFields+1)
For FieldNumber = 0 to NumberOfFields
FieldNames(FieldNumber)= rs.Fields(FieldNumber).Name
Next
rs.close
set rs=nothing
dbconn.close
set dbconn = Nothing

Response.write("Number of Records = " & NumberOfRecords)
Response.write("Number of Fields = " & NumberOfFields)

For RecordNumber = 0 to NumberOfRecords
Response.Write "<table border='1'><tr>"
For FieldNumber = 0 To NumberOfFields
Response.Write "<td><b>" & Trim(FieldNames(FieldNumber)) & ":</b> "
Response.write DataArray(FieldNumber, RecordNumber) & "</td>"
Next
Response.Write "</tr></table>"
Next
End Function
%>

"dmiller23462" <dm**********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
Somebody take a look and give me any suggestions? My brain is nuked...

Here's my deal....I have online submission forms on my intranet at
work here....I am appending to an Access DB with the input from all
HTML fields and then querying aforementioned DB with different
variables (search by name, wave, reason, etc). The output that I'm
getting (SELECT * 'cause I need all of the data included in the
search) I would like to display in a nice table or array but I'm not
quite sure how to make those settings "dynamic", for lack of a better
word. What I mean is, the form is used at various times throughout the
day so I don't want to put a cap on the array rows and columns since
they will be constantly increasing. Any suggestions?

Here's the code I have right now (I was playing around with display
ideas) and the table is the basic way I want it but the columns change
to fit whatever data is in them....That's not good, I want a RIGID
column that will be unwavering in it's data display...

Throw me a bone here...Thanks guys...

<%

Mode = request.form("mode")
Name = request.form("name")
Shift = request.form("shift")
Wave = request.form("wave")
Carton = request.form("carton")
Location = request.form("location")
License = request.form("license")
Sku = request.form("sku")
Qty = request.form("quantity")
Reason = request.form("reason")
Comments = request.form("comments")

'************************************************* **************************
**
'* DATABASE APPENDING
*

'************************************************* **************************
**
'create db connection
Set dbconn = Server.CreateObject("ADODB.Connection")

'open db in a DSN-less method
dbconn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&

Server.MapPath("/jax/wh/Online_Forms/Secured_Archives/search_files/shortage_
test.mdb")

'sql statement to return input values drawn from html fields
SQLqry = "SELECT * from test_data WHERE name LIKE '%%"&name&"%%'"

'display results of statement on screen for testing purposes
'Response.Write "<h3><b><u>" & (SQLqry) & "</u></b></h3><br>"

'remind db who it works for
Set rs = dbconn.Execute(SQLqry)

While Not rs.EOF
Response.Write "<table border='1'>"
Response.Write "<tr><td><b>Name:</b> " & rs("name")
Response.Write "<td>"
Response.Write "<b>Days/Nights:</b> " & rs("shift")
Response.Write "<td>"
Response.Write "<b>Wave Number:</b> " & rs("wave")
Response.Write "<td>"
Response.Write "<b>Carton Number:</b> " & rs("carton")
Response.Write "<td>"
Response.Write "<b>Location:</b> " & rs("location")
Response.Write "<td>"
Response.Write "<b>License:</b> " & rs("license")
Response.Write "<td>"
Response.Write "<b>SKU:</b> " & rs("sku")
Response.Write "<td>"
Response.Write "<b>Quantity:</b> " & rs("qty")
Response.Write "<td>"
Response.Write "<b>Reason:</b> " & rs("reason")
Response.Write "<td>"
Response.Write "<b>Comments:</b> " & rs("comments")
Response.Write "<td>"
Response.Write "<b>Date Submitted:</b> " & rs("date")
Response.Write "</td></table>"
rs.MoveNext
Wend

'smack around the db connection until it lets go
dbconn.Close

'terminate db connection with extreme prejudice
set dbconn = nothing

%>

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Petterson Mikael | last post by:
Hi, We are still using RoseRT to generate c++ code. Has anyone out there gone from using this tool another more convetional tool? I am interested in all hints and pointers. cheers, //mikael
3
by: Nick Gilbert | last post by:
Hi, In my VS.NET 2005, if I choose Build Clean Solution, the BIN folder is not touched. Shouldn't it delete all the dll and pdb files in that folder first? Instead, I'm finding I have to do it...
8
by: Ulysse | last post by:
Hello, I need to clean the string like this : string = """ bonne mentalit&eacute; mec!:) \n <br>bon pour info moi je suis un serial posteur arceleur dictateur ^^* \n ...
25
by: Koliber (js) | last post by:
sorry for my not perfect english i am really f&*ckin angry in this common pattern about dispose: ////////////////////////////////////////////////////////// Public class...
2
by: Bob Altman | last post by:
Hi, My VB project (VS 2005) has a post-build event that runs a program that creates an executable file in the target directory (that is, the same folder that contains the normal build results). ...
3
by: jcor | last post by:
Hi, I'm trying the "make distclean" comand. but I allways get this error: if I use the "make clean" I get the same error. Can someone teach me to use this commands, please? Thanks a lot, ...
8
by: plenty900 | last post by:
Hello, I'm trying to build a large project, and I've found that when something doesn't compile properly, and I attempt to re-build it, Visual C++ Express doesn't make a new attempt. So then I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.