Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Need help for displaying multiple records
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Need help for displaying multiple records

 Post Reply Post Reply
Author
canmasagi View Drop Down
Newbie
Newbie


Joined: 05 September 2004
Location: Indonesia
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote canmasagi Quote  Post ReplyReply Direct Link To This Post Topic: Need help for displaying multiple records
    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

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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.


Edited by dj air
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.