469,949 Members | 2,670 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

get the select statement without hex value using post method

When I use the following to post my value, I got SQL like this:
SELECT+A%2ECMPL%5FFIELD%5FID%2C+A%2ECMPL%5FFACILIT Y%.
How to get the SELECT without those hex value. THanks.
<FORM NAME='formname' METHOD=POST
ACTION='ExcelExport.asp?noIncludes=yes'>
<INPUT TYPE='Hidden' NAME='strSQL'
VALUE="<%=replace(server.urlencode(strsql),"'","`" )%>">
<tr><td BGCOLOR=E4E4E4 ID='bodytext' COLSPAN='8' align='center'><input
TYPE=SUBMIT value='export'></td></tr>
</form>


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 2996
Why are you server.urlencoding it when you're not passing it through the
url? Just don't server.urlencode it.

Also, instead of replacing ' with `, replace ' with ''. (That's two
apostrophes.)
If my name were Jim O'Brien, I'd be pretty irritated that I showed up as Jim
O`Brien. Actually, I wouldn't be, because I would have died in a
parachuting accident in the 80s, but that's beside the point.

Ray at work

"eddie wang" <ew***@kmg.com> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
When I use the following to post my value, I got SQL like this:
SELECT+A%2ECMPL%5FFIELD%5FID%2C+A%2ECMPL%5FFACILIT Y%.
How to get the SELECT without those hex value. THanks.
<FORM NAME='formname' METHOD=POST
ACTION='ExcelExport.asp?noIncludes=yes'>
<INPUT TYPE='Hidden' NAME='strSQL'
VALUE="<%=replace(server.urlencode(strsql),"'","`" )%>">
<tr><td BGCOLOR=E4E4E4 ID='bodytext' COLSPAN='8' align='center'><input
TYPE=SUBMIT value='export'></td></tr>
</form>


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
"eddie wang" <ew***@kmg.com> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
When I use the following to post my value, I got SQL like this:
SELECT+A%2ECMPL%5FFIELD%5FID%2C+A%2ECMPL%5FFACILIT Y%.
How to get the SELECT without those hex value. THanks.
Use HTMLEncode instead of URLEncode, since you're not writing a URL.


<FORM NAME='formname' METHOD=POST
ACTION='ExcelExport.asp?noIncludes=yes'>
<INPUT TYPE='Hidden' NAME='strSQL'
VALUE="<%=replace(server.urlencode(strsql),"'","`" )%>">
<tr><td BGCOLOR=E4E4E4 ID='bodytext' COLSPAN='8' align='center'><input
TYPE=SUBMIT value='export'></td></tr>
</form>


Try this:
<form name="formname" method="post" action="ExcelExport.asp?noIncludes=yes">
<input type="hidden" name="strSQL" value="<%=Server.HTMLEncode(strsql)%>">

Note, there's no need to replace ' with `, so don't.

Regards,
Peter Foti
Jul 19 '05 #3
Yes, server.urlencode is the problem. Thanks for the help!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Stephen Witter | last post: by
3 posts views Thread by Tcs | last post: by
29 posts views Thread by pb648174 | last post: by
7 posts views Thread by Steven Bethard | last post: by
4 posts views Thread by Ian Richardson | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.