|
 |
access_asp thread: Display 1 field of a DB table
Message #1 by "Jaclyn Ward" <misc@i...> on Mon, 11 Nov 2002 18:51:52
|
|
Newbie to ASP & ACCESS - first time posting,
Hi everyone...
I have a DB table called edit_pages & in it I have 4 columns: Number (auto
number), UserName, Password, Details.
What I want to do is to be able to display the "Details" field from
different rows in the same DB table (edit_pages) in separate HTML tables
on the same ASP page. Each row has a unique number so I was hoping to be
able to use the "Number" Field to reference which row I want the "Details"
Field to come from. Hope I'm making sense.
Below is the code I have so far. As you'll see there are 2 HTML tables &
it's in these <td>s that I want to display the "Details" info by Number.
TIA
jac.
<%@ Language=VBScript %>
<%Option Explicit %>
<!--#include file="adovbs.inc"-->
<!--#include file="DatabaseConnect.asp"-->
<html>
<head>
<title>CMS Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="cms.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
Dim objRS
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.Open "page_edits", objConn, , adLockOptimistic,
adCmdTable
%>
<table width="60%" border="0" cellspacing="0" cellpadding="4"
align="center">
<tr align="left" valign="top" bgcolor="#B7B7D0">
<td width="2%"><img src="images/cube.gif" width="8" height="8"
onClick="openChromeslessWindow('login.html','login',400,350,null,null,'CMS
Login', '#ACACC8', '#666699', '#ACACC8', '#666699' ,true,'Arial,
Helvetica, sans-serif', '1','#000000')"></td>
<td width="98%" class="main"><%=objRS("Details")%></td>
</tr>
</table>
<p> </p>
<table width="60%" border="0" cellspacing="0" cellpadding="4"
align="center">
<tr align="left" valign="top" bgcolor="#B7B7D0">
<td width="2%"><img src="images/cube.gif" width="8" height="8"
onClick="openChromeslessWindow('login.html','login',400,350,null,null,'CMS
Login', '#ACACC8', '#666699', '#ACACC8', '#666699' ,true,'Arial,
Helvetica, sans-serif', '1','#000000')"></td>
<td width="98%" class="main"><%=objRS("Details")%> </td>
</tr>
</table>
<p> </p>
<p>
<%
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
%>
</p>
</body>
</html>
Message #2 by "Larry Woods" <larry@l...> on Mon, 11 Nov 2002 11:58:37 -0700
|
|
Here is the type of logic you are looking for..I think(?) It's
not entirely clear what you ARE looking for, but..
.....heading stuff, etc.
<table width="60%" border="0" cellspacing="0" cellpadding="4"
align="center">
<%
do until objRS.EOF
%>
<tr align="left" valign="top" bgcolor="#B7B7D0">
<td width="2%"><img src="images/cube.gif" width="8"
height="8"
onClick="openChromeslessWindow('login.html','login',400,350,null,
null,'CMS
Login', '#ACACC8', '#666699', '#ACACC8', '#666699' ,true,'Arial,
Helvetica, sans-serif', '1','#000000')"></td>
<td width="98%" class="main"><%=objRS("Details")%></td>
</tr>
<%
objRS.MoveNext
loop
%>
</table>
...close, etc.
> -----Original Message-----
> From: Jaclyn Ward [mailto:misc@i...]
> Sent: Monday, November 11, 2002 6:52 PM
> To: Access ASP
> Subject: [access_asp] Display 1 field of a DB table
>
>
> Newbie to ASP & ACCESS - first time posting,
>
> Hi everyone...
> I have a DB table called edit_pages & in it I have 4
> columns: Number (auto
> number), UserName, Password, Details.
>
> What I want to do is to be able to display the
> "Details" field from
> different rows in the same DB table (edit_pages) in
> separate HTML tables
> on the same ASP page. Each row has a unique number so
> I was hoping to be
> able to use the "Number" Field to reference which row
> I want the "Details"
> Field to come from. Hope I'm making sense.
> Below is the code I have so far. As you'll see there
> are 2 HTML tables &
> it's in these <td>s that I want to display the
> "Details" info by Number.
>
> TIA
> jac.
>
>
>
> <%@ Language=VBScript %>
> <%Option Explicit %>
> <!--#include file="adovbs.inc"-->
> <!--#include file="DatabaseConnect.asp"-->
>
> <html>
> <head>
> <title>CMS Demo</title>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
> <link rel="stylesheet" href="cms.css" type="text/css">
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000">
> <%
> Dim objRS
> Set objRS=Server.CreateObject("ADODB.Recordset")
> objRS.Open "page_edits", objConn, ,
> adLockOptimistic,
> adCmdTable
>
> %>
>
> <table width="60%" border="0" cellspacing="0" cellpadding="4"
> align="center">
> <tr align="left" valign="top" bgcolor="#B7B7D0">
> <td width="2%"><img src="images/cube.gif"
> width="8" height="8"
> onClick="openChromeslessWindow('login.html','login',400
> ,350,null,null,'CMS
> Login', '#ACACC8', '#666699', '#ACACC8', '#666699'
> ,true,'Arial,
> Helvetica, sans-serif', '1','#000000')"></td>
> <td width="98%" class="main"><%=objRS("Details")%></td>
> </tr>
> </table>
>
> <p> </p>
> <table width="60%" border="0" cellspacing="0" cellpadding="4"
> align="center">
> <tr align="left" valign="top" bgcolor="#B7B7D0">
> <td width="2%"><img src="images/cube.gif"
> width="8" height="8"
> onClick="openChromeslessWindow('login.html','login',400
> ,350,null,null,'CMS
> Login', '#ACACC8', '#666699', '#ACACC8', '#666699'
> ,true,'Arial,
> Helvetica, sans-serif', '1','#000000')"></td>
> <td width="98%" class="main"><%=objRS("Details")%> </td>
> </tr>
> </table>
> <p> </p>
>
> <p>
> <%
> objRS.Close
> Set objRS=Nothing
> objConn.Close
> Set objConn=Nothing
> %>
> </p>
> </body>
> </html>
>
Message #3 by "Misc- Ingentus" <misc@i...> on Mon, 11 Nov 2002 19:15:30 -0000
|
|
Larry
Sorry if I'm not being very clear as to what I need to do - I'm a bit
unfamiliar with ASP & Access Speak.
Could you have a look at this URL and maybe it might seem clearer to you.
http://www.kidzklub.ie/cms/index.asp
TIA
jac.
Message #4 by "Larry Woods" <larry@l...> on Mon, 11 Nov 2002 12:36:27 -0700
|
|
jac,
It sounds like you just want to "sort" the records first, don't
you?
SELECT * FROM page_edits ORDER BY number
?????
Larry
> -----Original Message-----
> From: Misc- Ingentus [mailto:misc@i...]
> Sent: Monday, November 11, 2002 12:16 PM
> To: Access ASP
> Subject: [access_asp] RE: Display 1 field of a DB table
>
>
> Larry
> Sorry if I'm not being very clear as to what I need to
> do - I'm a bit
> unfamiliar with ASP & Access Speak.
>
> Could you have a look at this URL and maybe it might
> seem clearer to you.
>
> http://www.kidzklub.ie/cms/index.asp
>
>
> TIA
> jac.
>
>
>
>
>
>
Message #5 by "Jaclyn - Ingentus.com" <misc@i...> on Wed, 13 Nov 2002 17:26:37 -0000
|
|
Larry I wanted to be able to insert the "details" field info by referencing
the Number assigned in the Number column for that row....
Have another look if you have the time -
http://www.kidzklub.ie/cms/index.asp
TIA
jac.
----- Original Message -----
From: "Larry Woods" <larry@l...>
To: "Access ASP" <access_asp@p...>
Sent: Monday, November 11, 2002 7:36 PM
Subject: [access_asp] RE: Display 1 field of a DB table
> jac,
>
> It sounds like you just want to "sort" the records first, don't
> you?
>
> SELECT * FROM page_edits ORDER BY number
>
> ?????
>
> Larry
>
Message #6 by "Larry Woods" <larry@l...> on Wed, 13 Nov 2002 11:28:32 -0700
|
|
Are you saying that you want the record with the Number value of
5, for example, to be displayed in the 5th row of the table? If
this is not the case, then you need to give an example of a
couple of the records, where you think they should go in the
table, etc. It is NOT clear to me what you want to do.
Larry
> -----Original Message-----
> From: Jaclyn - Ingentus.com [mailto:misc@i...]
> Sent: Wednesday, November 13, 2002 10:27 AM
> To: Access ASP
> Subject: [access_asp] RE: Display 1 field of a DB table
>
>
> Larry I wanted to be able to insert the "details"
> field info by referencing
> the Number assigned in the Number column for that row....
>
> Have another look if you have the time -
> http://www.kidzklub.ie/cms/index.asp
>
> TIA
> jac.
>
> ----- Original Message -----
> From: "Larry Woods" <larry@l...>
> To: "Access ASP" <access_asp@p...>
> Sent: Monday, November 11, 2002 7:36 PM
> Subject: [access_asp] RE: Display 1 field of a DB table
>
>
> > jac,
> >
> > It sounds like you just want to "sort" the records
> first, don't
> > you?
> >
> > SELECT * FROM page_edits ORDER BY number
> >
> > ?????
> >
> > Larry
> >
>
>
>
>
|
|
 |