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