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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

response.redirect("page.asp?id=???????")

Status
Not open for further replies.

streborr

IS-IT--Management
Jan 16, 2002
98
How do I pass a value from a DB to open a new page that uses that value to return records where a field equals that value?

The sending page:

After all the connection stuff:

if trim(rsADO("user_group")) = "corp" then
response.redirect("corp.asp?user_company=(rsADO.user_Company)")
End if

After being sent to corp.asp, I want use the value from(rsADO.user_Company) in the SELECT:


The recieving page:

parent = (rsADO.user_Company)
connection stuff...
Select * From table Where Distributor = '" & parent & "'
rsADO.movefirst
do until rsADO.EOF
response.write("rsADO.dist_num")
rsADO.movenext
loop

rsADO.close
rsADO = nothing
%>

Thanks in advance for any help!
Rick


 
parent = request.queryString("user_company")
penny.gif
penny.gif
 
link9,
I tried your suggestion, but it still doesn't work.

Do you think maybe the error is in this line from the sending page?

if trim(rsADO("user_group")) = "corp" then
response.redirect("corp.asp?user_company=(rsADO.user_Company)")
end if

thanks
 
response.redirect("corp.asp?user_company=" & rsADO("user_Company"))
 
Thanks link9 and lobstah for the correct syntax!

That and I also added
<% response.buffer = clear %>
to the recieving page.

Everything is working perfect, thanks again.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top