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

concatenation

Status
Not open for further replies.

mary555

Programmer
Nov 9, 2005
185
CA
I am trying to do this:
ORID=request.querystring("ReferenceID") BUT I need to put a value after ReferenceID...the value is held in a variable named 'i'. i keeps incrementing. So I basically need it to be:
ORID=request.querystring("ReferenceID7") for example but i've held the number part in the 'i' variable and so now i need to retrieve that specific reference id. How would i add the 'i' part? If you need more clarificaiton let me know, its difficult to explain.
 
ORID = Request.QueryString("ReferenceID" & cStr(i))


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
try this sample pseudo code and see how it works...

Code:
<%
for i=0 to 10
blah = "ReferenceID" & i
ORID="request.querystring(""" & blah & """)"
response.write ORID & "<BR>"
next
%>

just giving you an idea...

-DNG
 
Hi,
Is the actual querystring going to have that # or do you need to set the ORID to the concatenated QueryString and the value in i?

If the latter then
ORID = request.querystring("ReferenceID") & i

should do it..( May need to convert number to string, however)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
ok im going to try these...thanks,,,and ill get right back to everyone!
 
george i tried your answer:
iValue=request.querystring("iValue")
response.write("IVALUE IS "& iValue) 'this prints 7
ORID=request.querystring("ReferenceID"&iValue)

but when i print ORDI, it doesn't have a value

im trying the other suggestions now
 
DNG,
is this what you think i should do?
iValue=request.querystring("iValue")
response.write("IVALUE IS "& iValue) 'and this will print 7
temp = "OutageReferenceID" & iValue
response.write("Temp"&temp) 'doesn't print anything after temp
ORID=request.querystring(temp)

am I doing something wrong?
 
TurkBear your solution worked so thanks very much! thanks everyone...
 
you havent described your question correctly to begin with..but anyways i am glad that Turkbear solution worked for you...

-DNG
 
oops actually it doesn't work...it just adds the ivalue to the end but doesn't get the right value
 
the printout of what it is getting is:
ReferenceID='1780' but it should be ReferenceID='178'

anything else I can try? DNG I think you understood my questions correctly..
 
DNG, with yours I get

Delete From Outages Where ReferenceID='request.querystring("ReferenceID5")

thats almost right!
 
did u try the code i provided...just create a new asp page and paste the code i provided and run it and see the output...

-DNG
 
how did you wanted the below to look...

Delete From Outages Where ReferenceID='request.querystring("ReferenceID5")

show us your code...

-DNG
 
yup i tried your code:

iValue=request.querystring("iValue")
response.write("IVALUE IS "& iValue)

blah = "ReferenceID" & iValue
ORID=request.querystring(""" & blah & """)
response.write "oridvalue "&ORID & "<BR>"

i took the quotes away from around request.querystring(""" & blah & """)

that makes no value appear for ORID, but when i do keep your quotes around it, it has the value for ORID as request.querystring("ReferenceID5") obviously
 
i want it to look like this
Delete From Outages Where ReferenceID='185'
 
in my first page i have this
<td align="center" ><input type="text" name="OutageReferenceID<%=i%>" value='<%= RS("OutageReferenceID")%>'></td>

in the asp page it calls, that is the value i am trying to retrieve
 
and i pass it like this
<a href="updateOutage.asp?ReferenceID=<%=RS("ReferenceID")%>............
 
ya i just put the quotes to show you as an example of how the request.querystring could be built...
so you are saying that this
ORID=request.querystring(""" & blah & """)

did not work...

are you sure your url has ReferenceID7 querystring parameter assuming your iValue to be 7

-DNG
 
Hi,
If i = 2 and
The 'source' ResponseID = 3 then do you want
ORID = 32?


OR, do you want to have it:

ORID = Request.QueryString("ResponseID32")




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top