navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

let me try this again

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> let me try this again
Page: [1]
 
oneqw5ltr

 

Posts: 68
Joined: 4/12/2004
Status: offline

 
let me try this again - 6/20/2008 7:31:37   
I have a hidden field on a page.

<input type="hidden" name="ID" value="<%=Request("ID")%>">

I get the ID on the page.

Now, i want to use that ID in a sql query on the same page....

SELECT objectid FROM system.cms_infoobjects5 WHERE parentid = (the ID from above).

how do i go about this?
pd_it_guy

 

Posts: 139
Joined: 3/4/2008
Status: offline

 
RE: let me try this again - 6/20/2008 10:40:40   
Let me get this straight.

Page 1 picks up a variable called 'X' from somewhere, and it gets POSTed, along with other variables to page 2. Is this where the hidden variable is passed?

Page 2 recovers that variable 'X' (in the '::X::' or just ::X:: numeric format) and includes it in an SQL query to an mdb, which runs when the page runs, to get result 'Y'. Thus, variable "Y" is now available to display or re-use. from the standard format that you would use to display the results in a list or table. (fp_rs("variable"))

Further down the page 2, you want to use result 'Y' not just to look at, but in yet another, unrelated SQL query, which will generate a second record set to display, or do what you want to.

Why can't you save the value of the extracted variable thus: new_x=fp_rs("Y") (I need to dig out the exact format if an example is not already there to copy), then use the new_x variable in the second query.

WHERE recordID=new_x

Is this what you tried?

(in reply to oneqw5ltr)
oneqw5ltr

 

Posts: 68
Joined: 4/12/2004
Status: offline

 
RE: let me try this again - 6/20/2008 10:54:05   
i pass the id from page 1 via a hyperlink to page 2 to show results from an access database. Then on page 2 i have the <input type="hidden" name="ID" value="<%=Request("ID")%>"> to get the ID that was just passed. (i am probably messing up right there. Then also on page 2 is where i want to us that ID field in a sql query. This sql query will query an Oracle database.

2 different databases but the ID field is relevant in both.

did i confuse it more?

(in reply to pd_it_guy)
pd_it_guy

 

Posts: 139
Joined: 3/4/2008
Status: offline

 
RE: let me try this again - 6/20/2008 11:57:37   
What I dont understand (yet, anyway) is, why you are making the new variable that you just extracted from your mdb on page 2, now a hidden form variable. That would certainly make sense if you were passing this new variable along as a POST operation to page 3, if there were one. Why don't you just use it in the SQL on page 2, so page 2 gives the final result of what you are going after.

You certainly could do this in stages where Page 1 posts to page 2, someting new is learned on page 2, and that gets automatically posted to page 3 for yet another query, but if I read right, all the action is on page 2. You certainly can run 2 queries in sequential order and I know of no reason why the results of one cant be turned right around and used in query 2 on page 2.

Let a few more weigh in on this so you dont miss a chance for a simple fix. If you dont get anything that helps perhaps you could post some code.

Are you using essentialized (dieted) code or the standared results region. Thta might make things a lot easier to see and work with, and the standard stuff is limited as to what you can edit.

(in reply to oneqw5ltr)
oneqw5ltr

 

Posts: 68
Joined: 4/12/2004
Status: offline

 
RE: let me try this again - 6/20/2008 12:02:41   
sorry for the stupidity but i figured it out. i knew i was wrong on the hidden field part. i just needed to set this id in a variable and then pass that variable in sql. it now works but thanks for getting back to me.

(in reply to pd_it_guy)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> let me try this again
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts