Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help updating record

Status
Not open for further replies.

Spyder1000

Technical User
Nov 2, 2004
109
US
My problem is I can't seem to get the hyper link that opens the update_form.asp to work. Basically it needs to provide a hyperlink that opens that page while at the same time pulling the record ID. For example it should look like:

Any takers?

Code:
<HTML>
<BODY>

<%
Set objConn = Server.CreateObject("ADODB.Connection")
  Set RS = Server.CreateObject("ADODB.Recordset") 
  FilePath = Server.MapPath("database.mdb")
  strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FilePath & ";" 
  objConn.Open strConn  

SQL_query = "SELECT * FROM tbl_maintable"

RS.Open SQL_query, objConn
%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-top-width:0" bordercolor="#111111" width="80%" id="AutoNumber2">
  <tr>
     <td width="20%" bgcolor="#000080" align="center" style="border-bottom-style: solid; border-bottom-width: 1; border-top-style:none; border-top-width:medium">
    <font color="#FFFFFF"><b>Record ID</b></font></td>
    <td width="40%" bgcolor="#000080" align="center" style="border-bottom-style: solid; border-bottom-width: 1; border-top-style:none; border-top-width:medium">
    <font color="#FFFFFF"><b>Name</b></font></td>
    <td width="40%" bgcolor="#000080" align="center" style="border-bottom-style: solid; border-bottom-width: 1; border-top-style:none; border-top-width:medium">
    <font color="#FFFFFF"><b>Score</b></font></td>
  </tr>
<%WHILE NOT RS.EOF%>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-left-width:0; border-right-width:0; border-top-width:0" bordercolor="#111111" width="80%" id="AutoNumber1">
  
<tr>
    <td width="20%" style="border-bottom-style: solid; border-bottom-width: 1; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium" align="center"><a href=""update_form.asp?ID=" & rs("RecordID")></td>
    <td width="40%" style="border-bottom-style: solid; border-bottom-width: 1; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium" align="center"><%=RS("name")%>&nbsp;</td>
    <td width="40%" style="border-bottom-style: solid; border-bottom-width: 1; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium" align="center"><%=RS("score")%>&nbsp;</td>
</tr>
</table>
<%
RS.MoveNext
WEND
%>
 
Hi Spyder

I think your code at the hyperlink is not closed with </a> and also I see an extra " at the line (ref=""update_form.asp?ID=" & rs("RecordID")>).

Anyway what error are you getting?

 
Right now I have:

Code:
("<a href=""update_form.asp?ID=" & rsGuestbook("RecordID") & """>")

What is suppose to happen is the update_form.asp will grab the RecordID and launch it as: Or whatever the RecordID is.

Currently all it does is launch without the rest of the address.
 
Can you please post the href that you get when you view the source from the web page?
 
try this:

("<a href="""update_form.asp?ID=" & rsGuestbook("RecordID") & """">")

observe the additional quotes...

-DNG
 
oops...some typos...try this...

Code:
 <td width="20%" style="border-bottom-style: solid; border-bottom-width: 1; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium" align="center"><a href="update_form.asp?ID="&rs("RecordID")&"></a></td>

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top