View Full Version : All Links to Detailed_Records.asp return same Record Info
Paul2
10-06-2005, 11:10 PM
I'm working in DreamweaverMX. When I upload my browse.asp and my detail.asp file to the server, I test the pages and when I roll over the links that are supposed to link me to the detail.asp they do not link me to the correct ID in the DB.
In the status bar, I can see that on mouse over, the ID#'s change like they are going to display the correct detailed record when clicked but keeps going to the same record.
PS. I'm using an Access DB
Any help would be greatly appreciated.
Brandoe85
10-06-2005, 11:38 PM
Hi, can you post the code please?
Paul2
10-07-2005, 12:11 AM
Sure Brando, I would be happy to.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/ADMconnect.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_ADMconnect_STRING
Recordset1.Source = "SELECT * FROM member ORDER BY sLastname, sFirstname ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>Member Yields</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#CCCC99">
<form action="" method="post" name="form1" id="form1">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="center">
<br>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="center"> View other query Results - <a href="#">Member
Yields</a> || <a href="orderby_date.asp">Order
by Date</a> ||
Order by Buck || Order by Doe</div>
</td>
</tr>
</table>
<table bgcolor="#FFFFFF"width="50%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td colspan="3"><div align="center"><strong><em></em></strong></div></td>
<td rowspan="3"><img src="../images/adm_logo_sm.jpg" width="68" height="78"></td>
</tr>
<tr>
<td colspan="3"><div align="center"><font size="2"></font></div></td>
</tr>
<tr>
<td colspan="3"><div align="center"><font size="3"><strong>2005
All Member Yields</strong></font></div></td>
</tr>
<tr>
<td colspan="3"><div align="center"><font size="2">Query listed
Alphabetically by <font color="#FF0000">Last Name</font></font></div></td>
<td> </td>
</tr>
<tr>
<td colspan="4"><div align="center">
</div>
</td>
</tr>
<tr bgcolor="#CCCC99">
<td width="20%"><div align="left">Date Posted:</div>
</td>
<td bgcolor="#FFFFCC"width="30%"><div align="left"><font color="#FF0000">Last Name:</font></div>
</td>
<td width="30%">First Name:</td>
<td width="20%"> Detail</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td width="20%"> <%=(Recordset1.Fields.Item("today").Value)%> </td><td width="30%"><%=(Recordset1.Fields.Item("sLastname").Value)%></td>
<td width="30%"><%=(Recordset1.Fields.Item("sFirstname").Value)%></td>
<td bgcolor="#FFFF99"width="20%"><A HREF="allMemberDetailed.asp?<%= MM_keepBoth & MM_joinChar(MM_keepBoth) & "sID=" & Recordset1.Fields.Item("sID").Value %>">view</A></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<tr>
<td colspan="4"><hr>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.