Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 23rd, 2003, 01:09 AM
Registered User
 
Join Date: Nov 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default how do you transfer a field value in the link

how do you transfer a field value in the link to another page.
Let me explain what I am trying to do

I have a field name called CAD # and I linked this value if it is true. But The page I linked is suposed the get the value of CAD #, but I doesn't.

Should I put some codes in the page where the link is , or in the page where the CAD # id being called.

Link Page:

if kayitseti.fields("Incident Report")="True" Then

   response.write("<td align=center> <a href='" &("incident.asp") & "'>" & kayitseti.fields("CAD #") & "</td>")
   Else
   response.write("<td align=center>" & kayitseti.fields("Incident Report") & "</td>")

  End If

Incident.asp:

<%


Set baglanti=Server.CreateObject("ADODB.connection" )
baglanti.Open "driver={microsoft access driver (*.mdb)}; DBQ=" &Server.MapPath("db/db2.mdb" )
SQL="select * from [TBL9- Reports] Where [CAD #]='"& [CAD #]&"'"
Set kayitseti = baglanti.Execute(SQL)
%>

<table border="0" width="100%">
  <tr>
    <td width="23%"><img border="0" src="images/badge7pntsml.gif" width="125" height="121"></td>
    <td width="77%"><b>Incident - Report for:</b>
      <p><b>CAD # :</b>
      <%
      response.write( kayitseti.fields("CAD #") )
      %>
      </td> .......

 I dont know where to start. I tried INNER JOIN but it did not work

 
Old December 23rd, 2003, 04:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It looks like the parentheses are messing up your link. Try this:

If kayitseti.Fields("Incident Report").Value ="True" Then
Response.Write("<td align=""center""><a href=""incident.asp?CAT=" & kayitseti.Fields("CAD #").Value & """></td>")


This will write out a link to incident.asp and passes the CAT # number in the QueryString, like this:

incidient.asp?CAT=1234
incidient.asp?CAT=4321

On incident.asp you can retrieve the value again:

Dim CatNr
CatNr = Request.QueryString("CAT")

If I were you, I'd rename the Cat # column. Using spaces and special characters in column names is going to get you in lots of troubles.....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 25th, 2003, 10:38 AM
Registered User
 
Join Date: Nov 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you,
It worked,:D
You made my day






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Unbound Date field to link with SQL VBA JackalBW BOOK: Access 2003 VBA Programmer's Reference 0 December 9th, 2007 06:29 AM
Copy previous field record if next field is null ecampos Access VBA 6 June 23rd, 2006 12:55 PM
Code transfer to form!field Quixote Access VBA 1 July 11th, 2005 09:51 AM
Update city field based on zip field nganb SQL Server ASP 0 April 22nd, 2004 10:30 PM
making a db field link on a page doranaz Classic ASP Databases 0 December 19th, 2003 01:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.