Print Page | Close Window

Need help for displaying multiple records

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11716
Printed Date: 30 March 2026 at 5:57am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Need help for displaying multiple records
Posted By: canmasagi
Subject: Need help for displaying multiple records
Date Posted: 06 September 2004 at 8:27pm

Hi... I have some problem that I need help from you all.

I am begginner in ASP and learned a lot from Web Wiz.

Recently I've made a database for displaying journals abstract and catalogue for my institution. I have difficulties in displaying more than one author for one Journal Title, here an example:

Title: Gold and Copper Prospect in........

Author(s): John Doe, Jane Doe, Nob Odyelse

Here's a script that I've wrote:

<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGrdcpubs 'Holds the recordset for the record in the database
Dim strSQL 'Holds the SQL query to query the database

'Create an ADO connection Object
Set adoCON = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={MICROSOFT Access Driver (*.mdb)}; DBQ=" & Server.MapPath("grdcpubs.mdb")

'Create an ADO recordset object
Set rsGrdcpubs = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT artikel.[no], art_author.name, art_author.title, artikel.number, artikel.volume, artikel.month, artikel.year, artikel.publication, artikel.cathegory, artikel.abstract FROM artikel INNER JOIN art_author ON artikel.title = art_author.title Where artikel.cathegory like 'Geo-Resources';"

'Open the recordset with the SQL Query
rsGrdcpubs.Open strSQL, adoCon

'Loop through the recordset
Do While not rsGrdcpubs.EOF
%>

<table width="95%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td class="text style42"><strong><a href="authors.asp?PenulisID=<% = rsGrdcpubs("name") %>" target="_self">
<span class="style25">
<% = rsGrdcpubs("name")%>
</span></a></strong>
<span class="style25"><br>
<% = rsGrdcpubs("title")%>
<br>
</span><span class="style32">| <a href="abstract.asp?AbstrakID=<% = rsGrdcpubs("abstract")%>" target="_self">ABSTRAK</a> |
<a href="mailto:my_library@mysite.com">DETAILS</a> |
</span> </td>
</tr>
</table>
<br>

<%
'Move to the nect record in the recordset
rsGrdcpubs.MoveNext

Loop
'Reset server objects
rsGrdcpubs.Close
Set rsGrdcpubs = Nothing
Set adoCon= Nothing

Here's the result:

John Doe
Gold and Copper Prospect in........
| Abstract | Details |

Jane Doe
Gold and Copper Prospect in........
| Abstract | Details |

Nob Odyelse
Gold and Copper Prospect in........
| Abstract | Details |

The Question is.....:

How can we wrote an ASP script especially for author field to yield the results such as:

John Doe Jane Doe Nob Odyelse
Gold and Copper Prospect in........
| Abstract | Details |

Regards

Canmasagi




Replies:
Posted By: dj air
Date Posted: 14 September 2004 at 4:29pm
you could query the category table and then get the title from the category and then do another query where the title = author title .. then

do a loop of the authors (write the authors)

 and then write the title bit.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net