473,323 Members | 1,550 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,323 software developers and data experts.

How to make the page?

Hello,
I'm trying to collect some data from one page, which have to be mixed up
neatly. This is the aim:

I collect the category names from a table in the database (tblCategorie).
The names are put neatly in a column. Then each category needs a list of
groups that have been entered. The groups are in the table 'tblGroepen'.

That is what I have got so far, but I don't know how combine it and make it
work.

Code:

<!-- #include file="inc/db_start.asp" -->
<!-- #include file="inc/Functies.asp" -->
<html>
<head>
<title></title>
<link href="Style/Default.css" type="text/css" rel="stylesheet">
</head>
<%
if Session("Pro_ID") = "" then
%> <html>
<head>
<title>Inloggen</title>
</head>
<body><center>
<font color="#FF0000">Je bent niet ingelogt!</font>
<br><br><br><br>
<%Call ShowLoginForm%>

</center>
</body>
</html>
<%
response.end
end if
%>
<html>
<head>
<title></title>
<link href="Style/Default.css" type="text/css" rel="stylesheet">
</head>
<body topmargin="10" leftmargin="10" rightmargin="10" bottommargin="10">
<table cellspacing="1" cellpadding="0">
<%
set rst = cnn.execute("SELECT * FROM tblCategorie")
do until rst.eof
%>
<tr>
<td bgcolor="#35559F" height="20">
<%=rst("CatNaam")%>
</td>
</tr>
<tr>
<td>
Groepen hier!
</td>
<tr>
<%rst.movenext
loop
rst.close
set rst = nothing
%>
</table>
<table cellspacing="1" cellpadding="0">
<% set rst = cnn.execute("SELECT * FROM tblGroepen")
do until rst.eof%>
<tr>
<td>
<%=rst("GrpNaam")%>
</td>
</tr>
<%rst.movenext
loop
rst.close
set rst = nothing%>
</table>
</body>
</html>
<!-- #include file="inc/db_end.asp" -->

Can anyone help me with this???

Regards

Robert.
Aug 9 '05 #1
2 1204
Combine it how? In one table? Are these two totally unrelated chunks of
data? You could try something like:

<%

Dim rsCat, rsGroup
Set rsCat = cnn.execute("SELECT CatNaam FROM tblCategorie")
Set rsGroup = cnn.Execute("SELECT GrpNaam FROM tblGroepen")

%>

<table border="1">
<tr>
<% Do %>
<td>
<%
If Not rsCat.EOF Then
Response.Write rsCat.Fields.Item("CatNaam").Value
Else
Response.Write "&nbsp;"
End If
%>
</td>
<td>
<%
If Not rsGroup.EOF Then
Response.Write rsGroup.Fields.Item("GrpNaam").Value
Else
Response.Write "&nbsp;"
End If
%>
</td>
</tr>
<%
On Error Resume Next
rsCat.MoveNext
rsGroup.MoveNext
On Error Goto 0

If rsCat.EOF And rsGroup.EOF Then Exit Do
Loop
%>
</table>
http://www.aspfaq.com/show.asp?id=2096

Ray at work
"Robert" <Bl*@bla.nl> wrote in message news:dd**********@news.cistron.nl...
Hello,
I'm trying to collect some data from one page, which have to be mixed up
neatly. This is the aim:

I collect the category names from a table in the database (tblCategorie).
The names are put neatly in a column. Then each category needs a list of
groups that have been entered. The groups are in the table 'tblGroepen'.

That is what I have got so far, but I don't know how combine it and make it work.

Code:

<!-- #include file="inc/db_start.asp" -->
<!-- #include file="inc/Functies.asp" -->
<html>
<head>
<title></title>
<link href="Style/Default.css" type="text/css" rel="stylesheet">
</head>
<%
if Session("Pro_ID") = "" then
%> <html>
<head>
<title>Inloggen</title>
</head>
<body><center>
<font color="#FF0000">Je bent niet ingelogt!</font>
<br><br><br><br>
<%Call ShowLoginForm%>

</center>
</body>
</html>
<%
response.end
end if
%>
<html>
<head>
<title></title>
<link href="Style/Default.css" type="text/css" rel="stylesheet">
</head>
<body topmargin="10" leftmargin="10" rightmargin="10" bottommargin="10">
<table cellspacing="1" cellpadding="0">
<%
set rst = cnn.execute("SELECT * FROM tblCategorie")
do until rst.eof
%>
<tr>
<td bgcolor="#35559F" height="20">
<%=rst("CatNaam")%>
</td>
</tr>
<tr>
<td>
Groepen hier!
</td>
<tr>

Aug 9 '05 #2
Perhaps have tables something like this:

tblCategorie:
CategorieID
CategorieName

tblGroepen:
GroepenID
CategorieID
GroepenName

And for a SQL string joinging the two tables:

strSQL = "SELECT tblCategorie.CategorieID, CategorieName, GroepenID,
GroepenName FROM tblCategorie LEFT JOIN tblGroepen ON
tblCategorie.CategorieID = tblGroepen.CategorieID ORDER BY
CategorieName, GroepenName"

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
<<
I collect the category names from a table in the database
(tblCategorie).
The names are put neatly in a column. Then each category needs a list of
groups that have been entered. The groups are in the table 'tblGroepen'.

That is what I have got so far, but I don't know how combine it and make
it
work.


*** Sent via Developersdex http://www.developersdex.com ***
Aug 12 '05 #3

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

Similar topics

31
by: Bruce W...1 | last post by:
This is a best practices question. For a website where PHP is used, does it make sense to have both .htm and .php files? In other words, for pages that have no active content there's no point...
7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
37
by: ajay | last post by:
How to make a web page getting refreshed after a given time interval automatically. HTML Code plz. Tx Ajay
5
by: Simon Harvey | last post by:
Hi there everyone, I have a fairly open ended but simple question that I could really use some assistance with. When I first bought visual studio (under the student license) i thought it was...
2
by: Dexter | last post by:
Hello all, I have webform1, and i need to make a bow to catch all textbox in my webform1. I tray this, but don't function. Dim obj As System.Web.UI.WebControls.TextBox Dim cont As Integer For...
6
by: Jeremy S. | last post by:
Sorry if this is too far OT - I posted this in the IIS group and got no response - so here goes: What would be a good or recommended way to make a Web site in IIS6 inaccessible to users on the...
1
by: jasdak | last post by:
i want to programatically make my page of varying height based on the content. if you go to trinadoula.com you will see what i am talking about. you'll see the mid section of the page is a bar...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
6
by: divya | last post by:
I have a page name edit.asp which should expire immediately .The user cannot open this page directly he has to provide a password for entering this page.thus when the user enters edit.asp , it has...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.