Retrieving data using a hyperlink in FP '03

  • Thread starter Kiratadas Kutikkad
  • Start date
K

Kiratadas Kutikkad

Hi, I have an Access '03 Db and am using FP '03 for webpages. In the first
page I am retrieving 2 fields of all records and made 1 field a hyperlink.
I want to retrieve all the data of 1 record when the user clicks on any of
the link field. But it comes out saying "no records found". For eg; I have
2 files called list.asp and results.asp. list.asp lists name and number
where name is a hyperlink. When the user clicks on one of the names it
calls results.asp to display all the fields of that record. This is part of
what I have in list.asp:
.........
fp_sQry="SELECT Name, Number FROM Students WHERE Class LIKE '%Grad%' ORDER
by Name ASC"
.......
<a href="results.asp?Name = <%=FP_FieldURL(fp_rs,"Name")%>
"><%=FP_FieldVal(fp_rs,"Name")%>

.......

Following is part of results.asp:

....

fp_sQry="SELECT * FROM Students WHERE Name = ' " & Name & " ' "

I can't figure out where the problem is. Any help is greatly appreciated.
 
T

Thomas A. Rowe

Name is a reserved word, so you need to change the field name to something else, i.e., StudentName
and I also wouldn't use the name field as the look up value, use the ID field.

<a href="results.asp?id = <%=FP_FieldURL(fp_rs,"ID")%>"><%=FP_FieldVal(fp_rs,"Name")%></a>


<%
ID = Request.QueryString("ID")

fp_sQry="SELECT * FROM Students WHERE ID = " & ID

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top