Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: Select from results of a form


Message #1 by REdwards@c... on Fri, 19 Apr 2002 19:18:11
Ok, I the search brings up the records and I have a details link under 
each record that reads /details.asp?varID=[unique id]. I click details and 
it sends me the details page and I can see in the url that everything is 
correct

For some reason I am not grabbing the ID in my asp or I am not connecting 
to the DB because all of the fields are blank. I am using the same code to 
connect to my DB as I use on the previous page.

here is my code for the page sans the connection stuff:

dim varID

varID=Request.Querystring("varID")

[connection stuff]

sqltext = "Select * FROM reqForm WHERE ID = " & varID & ";"
ors.Open sqltext, oConn


%>

<p>ID: <%=ID%></p>

<p>Name: <%=fullName%></p>

[Blah, blah, blah]

Am I not grabbing the querystring properly?


> When you pull back the initial search results, get the
unique ID from the table.  Then pass that ID back in
via the querystring to some page, hit the database and
get back the record where the ID matches the ID in the
table.

SQL:

Select Name, Request, Status, Request_ID
from Table
where some criteria

This will return 4 fields in the record.

Now, do something like this as your link for each
Request that is returned for the search:

response.write ("GetRequest.asp?id=" & Request_ID)

Make GetRequest.asp hit the database again, this time
only getting the record where the id from the
querysting matches the id from the table.

Mark

--- REdwards@c... wrote:
> I'm new to ASP and confusing myself on this concept.
> 
> 
> I have a DB where users submit help requests. I want
> them to be able to 
> search the DB for the status of their requests based
> on their name. This 
> may bring up multiple records as users will probably
> have multiple 
> requests. So the results page will only show Name,
> Nature of the request, 
> and Status.
> 
> All of that was easy to figure out. But I want to
> further allow users to 
> click individual of the results to get the details.
> But the results page 
> is html sent back to the browser. This is where I am
> confused. 
> 
> Each has a unique ID of course but how do I pass
> again to the database 
> from the results page to get the details of the
> record?
> 
> Robert


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
Message #2 by REdwards@c... on Fri, 19 Apr 2002 19:28:52
Nevermind, I'm a moron!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Message #3 by "Peter Foti (PeterF)" <PeterF@S...> on Thu, 18 Apr 2002 18:31:20 -0400
On the page that displays all of the results, when you create your link
to the "details" page, include the id as a parameter.  For example:

<a href="details.asp?id=5">

> -----Original Message-----
> From: REdwards@c... 
> [mailto:REdwards@c...]
> Sent: Thursday, April 18, 2002 11:30 PM
> To: ASP Databases
> Subject: [asp_databases] Select from results of a form
> 
> 
> I'm new to ASP and confusing myself on this concept. 
> 
> I have a DB where users submit help requests. I want them to 
> be able to 
> search the DB for the status of their requests based on their 
> name. This 
> may bring up multiple records as users will probably have multiple 
> requests. So the results page will only show Name, Nature of 
> the request, 
> and Status.
> 
> All of that was easy to figure out. But I want to further 
> allow users to 
> click individual of the results to get the details. But the 
> results page 
> is html sent back to the browser. This is where I am confused. 
> 
> Each has a unique ID of course but how do I pass again to the 
> database 
> from the results page to get the details of the record?
> 
> Robert
> 
Message #4 by REdwards@c... on Thu, 18 Apr 2002 23:30:11
I'm new to ASP and confusing myself on this concept. 

I have a DB where users submit help requests. I want them to be able to 
search the DB for the status of their requests based on their name. This 
may bring up multiple records as users will probably have multiple 
requests. So the results page will only show Name, Nature of the request, 
and Status.

All of that was easy to figure out. But I want to further allow users to 
click individual of the results to get the details. But the results page 
is html sent back to the browser. This is where I am confused. 

Each has a unique ID of course but how do I pass again to the database 
from the results page to get the details of the record?

Robert
Message #5 by Mark Eckeard <meckeard2000@y...> on Thu, 18 Apr 2002 17:24:04 -0700 (PDT)
When you pull back the initial search results, get the
unique ID from the table.  Then pass that ID back in
via the querystring to some page, hit the database and
get back the record where the ID matches the ID in the
table.

SQL:

Select Name, Request, Status, Request_ID
from Table
where some criteria

This will return 4 fields in the record.

Now, do something like this as your link for each
Request that is returned for the search:

response.write ("GetRequest.asp?id=" & Request_ID)

Make GetRequest.asp hit the database again, this time
only getting the record where the id from the
querysting matches the id from the table.

Mark

--- REdwards@c... wrote:
> I'm new to ASP and confusing myself on this concept.
> 
> 
> I have a DB where users submit help requests. I want
> them to be able to 
> search the DB for the status of their requests based
> on their name. This 
> may bring up multiple records as users will probably
> have multiple 
> requests. So the results page will only show Name,
> Nature of the request, 
> and Status.
> 
> All of that was easy to figure out. But I want to
> further allow users to 
> click individual of the results to get the details.
> But the results page 
> is html sent back to the browser. This is where I am
> confused. 
> 
> Each has a unique ID of course but how do I pass
> again to the database 
> from the results page to get the details of the
> record?
> 
> Robert


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

  Return to Index