Re: Server.URLEncod e :-(
OK, on page 1, when i click the link that has the apostrophy in -
******
<a href= "summary_manage r.asp?manager=< %=RS("manager") %>"><%[color=blue][color=green]
>> =RS("manager")% ></a>[/color][/color]
******
I get a invalid syntax near 'S' error. this is the link that links to page
2, but only the one with the apostrophy is erroring.
--
Thanks in advance
Fawke
Please remove ANTI and SPAM
from my email address before emailing me.
"Randy Rahbar" <rvrahbar@_JUNK ETY_JUNK_hotmai l.com> wrote in message
news:uW$9$PaDEH A.1604@TK2MSFTN GP11.phx.gbl...[color=blue]
> Fawke, which page - and which line - are you actually getting an error on?
>
>
>
> "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
> news:%23q5aJtZD EHA.624@TK2MSFT NGP10.phx.gbl.. .[color=green]
> > Note i havent implemented the function or the Server URLEncode because[/color][/color]
it[color=blue][color=green]
> > doesnt work, this is my code as it stands now.
> >
> > ****Summary_Are a.asp(Page1)*** ***
> >
> > <%Dim RS
> >
> > Function sql_quote (str)
> > sql_quote = Replace(str,"'" ,"''")
> > End Function
> >
> > Set RS = DataConnection. Execute("SELECT manager, customer, income, FROM
> > vw_Summary_Area WHERE vw_Summary_Area .Area='" & Session("lstAre a") &[/color][/color]
"'")[color=blue][color=green]
> > do until RS.EOF
> > %>
> > <a href= "summary_manage r.asp?manager=< %=RS("manager") %>"><%
> > =RS("manager")% ></a>
> >
> > <% =RS("customer") %>
> >
> > <% =formatcurrency (RS("income"),2 )%>
> >
> > <% RS.MoveNext
> > Loop %>
> >
> > *************** *************** **
> > ****Summary_Man ager.asp(Page2) ****
> >
> > <%Dim RS
> >
> > Function sql_quote (str)
> > sql_quote = Replace(str,"'" ,"''")
> > End Function
> >
> > Set RS = DataConnection. Execute("SELECT assistant_manag er, customer,[/color]
> income[color=green]
> > FROM vw_Summary_Mana ger WHERE vw_Summary_Mana ger.manager='" &
> > request.queryst ring("manager") & "'")
> > do until RS.EOF
> >
> > <a href=
> >[/color]
>[/color]
"summary_assist ant_manager.asp ?assistant_mana ger=<%=RS("assi stant_manager") %[color=blue][color=green][color=darkred]
> > >"><% =RS ("assistant_man ager")%></a>[/color]
> >
> > <% =RS("customer") %>
> >
> > <% =formatcurrency (RS("income"),2 )%>
> >
> > <% RS.MoveNext
> > Loop %>
> >
> > *************** *************** *
> > To get to page1 you select an area from a list box and click submit.[/color][/color]
data[color=blue]
> is[color=green]
> > arranged in accordance to the selection. A list of managers are listed[/color][/color]
for[color=blue][color=green]
> > that area, along with their customers and income. If you click on the
> > manager you go to page 2 and get a breakdown of the assistant manager/s[/color]
> for[color=green]
> > that manager and so on and so on.......
> >
> > I hope this has made it a bit clearer.
> >
> > --
> > Thanks in advance
> >
> > Fawke
> >
> > Please remove ANTI and SPAM
> > from my email address before emailing me.
> >
> > www.bradflack.com
> > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
> > news:#Ev60sUDEH A.3692@tk2msftn gp13.phx.gbl...[color=darkred]
> > > jesus man, i didnt mean to annoy anyone.
> > > Il post the "actual" code.
> > >
> > > The reason that the 2 select statements differ, is because the data is
> > > coming from a different view etc.
> > > On page1.asp the data comes from view1 etc. The value of that data is[/color][/color]
> put[color=green][color=darkred]
> > > into a querystring in order for page2.asp (which gets its data from[/color]
> > ANOTHER[color=darkred]
> > > view - view2) to proccess the data.
> > > I will paste my code up here without the naming ammendments, just[/color][/color]
> thought[color=green][color=darkred]
> > > it'd be easier (clearly not).
> > >
> > > Apologies once again for annoying you guys
> > >
> > > --
> > > Thanks in advance
> > >
> > > Fawke
> > >
> > > Please remove ANTI and SPAM
> > > from my email address before emailing me.
> > >
> > > www.bradflack.com
> > > "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
> > > news:ei8lJuSDEH A.3404@TK2MSFTN GP10.phx.gbl...
> > > > I think if Fawke101 were to use real column/parameter names instead[/color][/color][/color]
of[color=blue][color=green][color=darkred]
> > > > kludging it up with this COL1/COL2 nonsense we'd get to the bottom[/color][/color][/color]
of[color=blue][color=green]
> > this[color=darkred]
> > > a
> > > > lot quicker.
> > > >
> > > > --
> > > > Aaron Bertrand
> > > > SQL Server MVP
> > > > http://www.aspfaq.com/
> > > >
> > > >
> > > > "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in[/color]
> > message[color=darkred]
> > > > news:105jum4k6j 5jb6e@corp.supe rnews.com...
> > > > > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
> > > > > news:ejFaFVRDEH A.2600@TK2MSFTN GP09.phx.gbl...
> > > > > > that doesnt work tho, it completely ignores it and still[/color][/color][/color]
generates[color=blue]
> a[color=green]
> > '[color=darkred]
> > > > > > i cant get this damn thing to work, its not your fault, im sure[/color][/color][/color]
im[color=blue][color=green][color=darkred]
> > > doing
> > > > > > something wrong here.
> > > > > >
> > > > > > The page with the link (with the apostrophy) -
> > > > > > ****page1.asp** **
> > > > > >
> > > > > > Function SQL_QUOTE (str)
> > > > > > SQL_QUOTE = Replace(str,"'" ,"''")
> > > > > > End Function
> > > > > >
> > > > > > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM view1[/color][/color]
> WHERE[color=green][color=darkred]
> > > > > > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
> > > > > >
> > > > > > 'incorrect link looks like - St Mathew's - when clicked -
> > > > > >
> > > > > > <a href= "page2.asp?VALU E=<%[/color][/color][/color]
=server.urlenco de(RS("value1") )%>"><%[color=blue][color=green][color=darkred]
> > > > > > =RS("value1")%> </a>
> > > > > >
> > > > > > *************** *
> > > > > > Then on page2.asp
> > > > > >
> > > > > > Function SQL_QUOTE (str)
> > > > > > SQL_QUOTE = Replace(str,"'" ,"''")
> > > > > > End Function
> > > > > >
> > > > > > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM view2[/color][/color]
> WHERE[color=green][color=darkred]
> > > > > > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
> > > > > > *************** *
> > > > > > and so on like that........... ..............
> > > > >
> > > > >
> > > > > You're making this difficult to debug... which is the correct
> > > querystring
> > > > > variable name, "value" or "value1"? On page1.asp you called it[/color]
> > "value"[color=darkred]
> > > > and
> > > > > on page 2 you are trying to reference "value1". In addition, you[/color][/color]
> used[color=green][color=darkred]
> > > the
> > > > > fieldnames "COL1" and "COL2" in the query above that. WHICH IS[/color][/color]
> IT???[color=green][color=darkred]
> > > > Also,
> > > > > your query on page2.asp is pulling from table "view2", but using a[/color]
> > value[color=darkred]
> > > > > from "view1"???? Are these cut and paste errors?
> > > > >
> > > > > Peter
> > > > > PS- Odd naming convention (giving the sql_quote function all[/color][/color]
> uppercase[color=green][color=darkred]
> > > > > letters... very strange).
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]
OK, on page 1, when i click the link that has the apostrophy in -
******
<a href= "summary_manage r.asp?manager=< %=RS("manager") %>"><%[color=blue][color=green]
>> =RS("manager")% ></a>[/color][/color]
******
I get a invalid syntax near 'S' error. this is the link that links to page
2, but only the one with the apostrophy is erroring.
--
Thanks in advance
Fawke
Please remove ANTI and SPAM
from my email address before emailing me.
"Randy Rahbar" <rvrahbar@_JUNK ETY_JUNK_hotmai l.com> wrote in message
news:uW$9$PaDEH A.1604@TK2MSFTN GP11.phx.gbl...[color=blue]
> Fawke, which page - and which line - are you actually getting an error on?
>
>
>
> "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
> news:%23q5aJtZD EHA.624@TK2MSFT NGP10.phx.gbl.. .[color=green]
> > Note i havent implemented the function or the Server URLEncode because[/color][/color]
it[color=blue][color=green]
> > doesnt work, this is my code as it stands now.
> >
> > ****Summary_Are a.asp(Page1)*** ***
> >
> > <%Dim RS
> >
> > Function sql_quote (str)
> > sql_quote = Replace(str,"'" ,"''")
> > End Function
> >
> > Set RS = DataConnection. Execute("SELECT manager, customer, income, FROM
> > vw_Summary_Area WHERE vw_Summary_Area .Area='" & Session("lstAre a") &[/color][/color]
"'")[color=blue][color=green]
> > do until RS.EOF
> > %>
> > <a href= "summary_manage r.asp?manager=< %=RS("manager") %>"><%
> > =RS("manager")% ></a>
> >
> > <% =RS("customer") %>
> >
> > <% =formatcurrency (RS("income"),2 )%>
> >
> > <% RS.MoveNext
> > Loop %>
> >
> > *************** *************** **
> > ****Summary_Man ager.asp(Page2) ****
> >
> > <%Dim RS
> >
> > Function sql_quote (str)
> > sql_quote = Replace(str,"'" ,"''")
> > End Function
> >
> > Set RS = DataConnection. Execute("SELECT assistant_manag er, customer,[/color]
> income[color=green]
> > FROM vw_Summary_Mana ger WHERE vw_Summary_Mana ger.manager='" &
> > request.queryst ring("manager") & "'")
> > do until RS.EOF
> >
> > <a href=
> >[/color]
>[/color]
"summary_assist ant_manager.asp ?assistant_mana ger=<%=RS("assi stant_manager") %[color=blue][color=green][color=darkred]
> > >"><% =RS ("assistant_man ager")%></a>[/color]
> >
> > <% =RS("customer") %>
> >
> > <% =formatcurrency (RS("income"),2 )%>
> >
> > <% RS.MoveNext
> > Loop %>
> >
> > *************** *************** *
> > To get to page1 you select an area from a list box and click submit.[/color][/color]
data[color=blue]
> is[color=green]
> > arranged in accordance to the selection. A list of managers are listed[/color][/color]
for[color=blue][color=green]
> > that area, along with their customers and income. If you click on the
> > manager you go to page 2 and get a breakdown of the assistant manager/s[/color]
> for[color=green]
> > that manager and so on and so on.......
> >
> > I hope this has made it a bit clearer.
> >
> > --
> > Thanks in advance
> >
> > Fawke
> >
> > Please remove ANTI and SPAM
> > from my email address before emailing me.
> >
> > www.bradflack.com
> > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
> > news:#Ev60sUDEH A.3692@tk2msftn gp13.phx.gbl...[color=darkred]
> > > jesus man, i didnt mean to annoy anyone.
> > > Il post the "actual" code.
> > >
> > > The reason that the 2 select statements differ, is because the data is
> > > coming from a different view etc.
> > > On page1.asp the data comes from view1 etc. The value of that data is[/color][/color]
> put[color=green][color=darkred]
> > > into a querystring in order for page2.asp (which gets its data from[/color]
> > ANOTHER[color=darkred]
> > > view - view2) to proccess the data.
> > > I will paste my code up here without the naming ammendments, just[/color][/color]
> thought[color=green][color=darkred]
> > > it'd be easier (clearly not).
> > >
> > > Apologies once again for annoying you guys
> > >
> > > --
> > > Thanks in advance
> > >
> > > Fawke
> > >
> > > Please remove ANTI and SPAM
> > > from my email address before emailing me.
> > >
> > > www.bradflack.com
> > > "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
> > > news:ei8lJuSDEH A.3404@TK2MSFTN GP10.phx.gbl...
> > > > I think if Fawke101 were to use real column/parameter names instead[/color][/color][/color]
of[color=blue][color=green][color=darkred]
> > > > kludging it up with this COL1/COL2 nonsense we'd get to the bottom[/color][/color][/color]
of[color=blue][color=green]
> > this[color=darkred]
> > > a
> > > > lot quicker.
> > > >
> > > > --
> > > > Aaron Bertrand
> > > > SQL Server MVP
> > > > http://www.aspfaq.com/
> > > >
> > > >
> > > > "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in[/color]
> > message[color=darkred]
> > > > news:105jum4k6j 5jb6e@corp.supe rnews.com...
> > > > > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
> > > > > news:ejFaFVRDEH A.2600@TK2MSFTN GP09.phx.gbl...
> > > > > > that doesnt work tho, it completely ignores it and still[/color][/color][/color]
generates[color=blue]
> a[color=green]
> > '[color=darkred]
> > > > > > i cant get this damn thing to work, its not your fault, im sure[/color][/color][/color]
im[color=blue][color=green][color=darkred]
> > > doing
> > > > > > something wrong here.
> > > > > >
> > > > > > The page with the link (with the apostrophy) -
> > > > > > ****page1.asp** **
> > > > > >
> > > > > > Function SQL_QUOTE (str)
> > > > > > SQL_QUOTE = Replace(str,"'" ,"''")
> > > > > > End Function
> > > > > >
> > > > > > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM view1[/color][/color]
> WHERE[color=green][color=darkred]
> > > > > > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
> > > > > >
> > > > > > 'incorrect link looks like - St Mathew's - when clicked -
> > > > > >
> > > > > > <a href= "page2.asp?VALU E=<%[/color][/color][/color]
=server.urlenco de(RS("value1") )%>"><%[color=blue][color=green][color=darkred]
> > > > > > =RS("value1")%> </a>
> > > > > >
> > > > > > *************** *
> > > > > > Then on page2.asp
> > > > > >
> > > > > > Function SQL_QUOTE (str)
> > > > > > SQL_QUOTE = Replace(str,"'" ,"''")
> > > > > > End Function
> > > > > >
> > > > > > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM view2[/color][/color]
> WHERE[color=green][color=darkred]
> > > > > > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
> > > > > > *************** *
> > > > > > and so on like that........... ..............
> > > > >
> > > > >
> > > > > You're making this difficult to debug... which is the correct
> > > querystring
> > > > > variable name, "value" or "value1"? On page1.asp you called it[/color]
> > "value"[color=darkred]
> > > > and
> > > > > on page 2 you are trying to reference "value1". In addition, you[/color][/color]
> used[color=green][color=darkred]
> > > the
> > > > > fieldnames "COL1" and "COL2" in the query above that. WHICH IS[/color][/color]
> IT???[color=green][color=darkred]
> > > > Also,
> > > > > your query on page2.asp is pulling from table "view2", but using a[/color]
> > value[color=darkred]
> > > > > from "view1"???? Are these cut and paste errors?
> > > > >
> > > > > Peter
> > > > > PS- Odd naming convention (giving the sql_quote function all[/color][/color]
> uppercase[color=green][color=darkred]
> > > > > letters... very strange).
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]
Comment