If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Creating hyperlink lookups...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-28-05, 16:08
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
Creating hyperlink lookups...

Hi again. I'm trying to make an applicaiton which involves searching for a particular case, allowing the user to pick a particular case, and then viewing the details about that particular case. Here is what I want to do. I have a page where a user types in a case number, phone number, etc. to search for. The search returns a list of results matching this criteria and makes the results hyperlinked. The user then clicks on one of the hyperlinked results to view the details of that particular case. I have some ASP knowledge...how easy would something like this be to create? Does anybody know of any tutorials available to do something like this? Thanks for any help.
Reply With Quote
  #2 (permalink)  
Old 02-28-05, 17:24
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
I don't know of any tutorials, but it is pretty easy, basically you link from your search results page to you caseview page passing the case identifier in the url.

You then request.querystring the case identifier and use it to run a full query against the database to return and display all the details for that case.
Reply With Quote
  #3 (permalink)  
Old 02-28-05, 21:38
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
Could you show me a sample of how you would like to it? I really don't know where to start b/c I've never done anything like this before. And the lack of tutorials doesn't really help.
Reply With Quote
  #4 (permalink)  
Old 02-28-05, 21:41
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Well that depends on where you want me to start,.... the search part? the creating the link part, the doing the individual look up. What do you current know about asp and databases? What tools are you using?
Reply With Quote
  #5 (permalink)  
Old 02-28-05, 21:49
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
I know how to connect to a database and query it through ASP using a searchbox and dropdown menus...I need help making the links. I'm using Dreamweaver 2004.
Reply With Quote
  #6 (permalink)  
Old 02-28-05, 21:54
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Well I've never used dreamweaver so I can't really tell you how to do it with that...

I can give you basic source code and instruction on how things hold together. Do you understand what dreamweaver does "under the covers"?
Reply With Quote
  #7 (permalink)  
Old 02-28-05, 21:58
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Do you have a page that currently displays search results? If so, post it here and I will alter it to include a link
Reply With Quote
  #8 (permalink)  
Old 02-28-05, 21:59
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
I have access to visual studio .net 2003 if you use that...or what program do you use?
Reply With Quote
  #9 (permalink)  
Old 02-28-05, 22:08
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Generally I'll use a Visual Studio product of some description. But like I said, do you have a working search page at the moment that displays results? if so, post that and I'll add a section in that creates the links.
Reply With Quote
  #10 (permalink)  
Old 02-28-05, 22:11
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
i dont' have it at the moment...i'm at home now and i won't be able to post it until tomorrow morning if that's okay with you?
Reply With Quote
  #11 (permalink)  
Old 02-28-05, 22:12
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
i thought it would be easier than it's going to be!
Reply With Quote
  #12 (permalink)  
Old 02-28-05, 22:14
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
It's really not that difficult at all, but trying to explain it would probably take alot longer then just showing how it is done....
Reply With Quote
  #13 (permalink)  
Old 03-02-05, 10:58
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
I have two pages right now. I have a search.htm which contains a LastName and FirstName input boxes and a search button. The search.htm passes this information to search.asp, which is in the code below.

Code:
<html>
<head><title></title><link href="../hcda.css" rel="stylesheet" type="text/css"></head>
<body>

<%

'Variables
Dim adoCon		'Connection Object
Dim rsBan		'Recordset
Dim strSQL		'SQL String
Dim intNum		'Counting

Set conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={SQL Server};" & _
           "Server=XXX.XXX.XXX.XXX;" & _
           "Address=XXX.XXX.XXX.XXX,1433;" & _
           "Network=DBMSSOCN;" & _
           "Database=PDData;" & _
           "Uid=XXXXXXX;" & _
           "Pwd=XXXXXXX"

strSQL = "SELECT DefendantCase.CaseNumber, DefendantCase.LastName, DefendantCase.FirstName, DefendantCase.MiddleName, StatusDescription.[Description] AS Status FROM DefendantCase JOIN StatusDescription ON StatusDescription.StatusID=DefendantCase.StatusID WHERE LastName LIKE '%" & Request.Form("LastName") & "%' AND FirstName LIKE '%" & Request.Form("FirstName") & "%' ORDER BY DefendantCase.LastName"
Set rsBan = Server.CreateObject("ADODB.Recordset")

rsBan.Open strSQL, conn

If rsBan.BOF and rsBan.EOF Then %>
<table width="743" border="0" align="center">
  <tr align="left" valign="top"> 
    <td rowspan="2"><a href="http://www.houstonda.org"><img src="DAseal.jpg" width="320" height="319" border="0" alt="HCDA"></a></td>
    <td width="548" height="35"> 
      <div align="center"><font face="Georgia, Times New Roman, Times, serif"><b><font size="4">Houston County Information System</font></b></font></div>
    </td>
  </tr>
  <tr> 
    <td width="548" align="left" valign="top"> 
      <p>&nbsp;</p>
      <table width="50%" border="0" align="center">
        <tr> 
          <td align="left" valign="top"> 
            <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif"> 
              <a href="index.asp">Home</a> | <a href="listall.asp">List All</a></font></div>
          </td>
        </tr>
      </table>
      <table width="99%" border="0">
        <tr> 
          <td align="left" valign="top">
            <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>The 
              search yielded no results. Please try again.</b></font> 
              <form action="search.asp" method="post" name="search" id="search">
                <font face="Tahoma"> 
                <table cellspacing="0" cellpadding="0" border="0">
                  <tr> 
                    <td valign="top">Last Name: </td>
                    <td valign="top"> 
                      <input type="text" name="LastName" size="25" maxlength="25">
                    </td>
                  </tr>
                  <tr> 
                    <td colspan="2" valign="top"> 
                      <div align="right"> 
                        <input type="submit" name="Submit">
                      </div>
                    </td>
                  </tr>
                </table>
                </font>
              </form>
            </div>
          </td>
        </tr>
      </table>
      <p>&nbsp;</p>
    </td>
  </tr>
</table>

<% Else
	Response.Write("<table width=960 border=0 bordercolor=#CCCCCC cellpadding=0 cellspacing=0 align=center>")
	Response.Write("  <tr align=left valign=top> ")
	Response.Write("  <td align=center><a href=index.asp>Home</a> | <a href=search.html>Search</a></td>")
	Response.Write("</tr>")
	Response.Write("</table>")
	Response.Write("<div align=center><img src=head.jpg alt=HCDA border=0></div>")
	Response.Write("<table border=1 bordercolor=#CCCCCC cellpadding=0 cellspacing=0>")
	Response.Write("  <tr align=left valign=top> ")
	Response.Write("    <td><font size=2></font></td>")
	Response.Write("	<td><b><font size=2>Case Number</font></b></td>")
	Response.Write("    <td><b><font size=2>Defendant</font></b></td>")
	Response.Write("    <td><b><font size=2>Case Status</font></b></td>")
	Response.Write("  </tr>")
'If Not rsBan.EOF Then 
'
'
Do While Not rsBan.EOF
intNum = intNum + 1
	Response.Write("  <tr align=left valign=top> ")
	Response.Write("    <td width=15><font size=2>")
	Response.Write(intNum)
	Response.Write("</font></td>")
	Response.Write(" <td><font size=2>")
	Response.Write(rsBan("CaseNumber"))
	Response.Write("</font></td>")
	Response.Write("    <td><font size=2>")
	Response.Write(rsBan("LastName"))
	Response.Write(", ")
	Response.Write(rsBan("Firstname"))
	Response.Write(" ")
	Response.Write(rsBan("MiddleName"))
	Response.Write("</font>	</td>")
	Response.Write("    <td><font size=2>")
	Response.Write(rsBan("Status"))
	Response.Write("</font></td>")
rsBan.MoveNext

Loop

'End If
End If

rsBan.Close
Set rsBan = Nothing
Set adoCon = Nothing
%>
I would like the results hyperlinked so a user can click on a link, then show the details about a particular case. I'm sorry to have taken so long but things happen around the office. Thanks again for you help.
Reply With Quote
  #14 (permalink)  
Old 03-02-05, 17:10
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
I have attached a new version of that code for you. Basically I have added an extra column to the end of you table with the link. There is a variable set up to hold the page you want to got to and the querystring variable which you will need to change to point to whatever you want to call your page to display the full details.

HTH.
Attached Files
File Type: txt createLink.txt (4.9 KB, 34 views)
Reply With Quote
  #15 (permalink)  
Old 03-03-05, 10:43
bla4free bla4free is offline
Registered User
 
Join Date: Jan 2005
Posts: 165
thank you for the page. it was very generous of you. i had no idea it was actually that simple. now i have a new question for you. how do i go about making the displayCase.asp page? i know the sql statement i want to use, but exactly how would i begin the page so it would display those results? thanks again for your help!!!!

When I say how would i begin the page, i mean, how do i carry over that inforamtion from the previous page? Do I put a statement in my sql string? I'm thinking it will go in the WHERE clausse but i'm still unsure. Thanks for your help!

Last edited by bla4free; 03-03-05 at 12:43.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On