Server.URLEncode :-(

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fawke101

    Server.URLEncode :-(

    Hi there,

    I am having trouble with some data that is ripped from a SQL database and
    displayed as a hyperlink.
    The hyperlink inserts the data into a querystring so the next page can read
    it.

    However, some of the data has apostrophies (') in it, so the page does not
    redirect properly (invalid syntax) because of the apostrophy.
    so i tried to use the URL encode to get around this to no avail - it doesnt
    work.
    The hyperlink is as follows, is this correct - if so why aint it working
    :-( ? and is this the "best" way to get around this problem?

    *****

    <a href= "page2.asp?DATA =<% server.URLEncod e(=RS("Value")) %>"><%
    =RS("Value")%></a>

    *****

    Thanks
    --
    Thanks in advance

    Fawke

    Please remove ANTI and SPAM
    from my email address before emailing me.

    Servant of the most high God, empowered by the Holy Spirit, humbly following my savior Jesus Christ



  • Peter Foti

    #2
    Re: Server.URLEncod e :-(

    "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
    news:umz8YJQDEH A.2424@TK2MSFTN GP09.phx.gbl...[color=blue]
    > However, some of the data has apostrophies (') in it, so the page does not
    > redirect properly (invalid syntax) because of the apostrophy.
    > so i tried to use the URL encode to get around this to no avail - it[/color]
    doesnt[color=blue]
    > work.
    > The hyperlink is as follows, is this correct - if so why aint it working
    > :-( ? and is this the "best" way to get around this problem?
    >
    > *****
    >
    > <a href= "page2.asp?DATA =<% server.URLEncod e(=RS("Value")) %>"><%
    > =RS("Value")%></a>
    >
    > *****[/color]

    You are missing an equal sign or Response.Write statement before
    server.URLEncod e, and you have an equal sign incorrectly before RS("Value").
    Try this:
    <a href=
    "page2.asp?DATA =<%=server.URLE ncode(RS("Value "))%>"><%=RS("V alue")%></a>

    Regards,
    Peter Foti



    Comment

    • Ray at

      #3
      Re: Server.URLEncod e :-(

      An apostrophe in a URL shouldn't matter. In what way, "aint it working?"
      Do you get an error? What is the value of RS("Value")? What does your link
      look like in a view source? When does the error occur? In what code does
      the error occur?

      Ray at work


      "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
      news:umz8YJQDEH A.2424@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Hi there,
      >
      > I am having trouble with some data that is ripped from a SQL database and
      > displayed as a hyperlink.
      > The hyperlink inserts the data into a querystring so the next page can[/color]
      read[color=blue]
      > it.
      >
      > However, some of the data has apostrophies (') in it, so the page does not
      > redirect properly (invalid syntax) because of the apostrophy.
      > so i tried to use the URL encode to get around this to no avail - it[/color]
      doesnt[color=blue]
      > work.
      > The hyperlink is as follows, is this correct - if so why aint it working
      > :-( ? and is this the "best" way to get around this problem?
      >
      > *****
      >
      > <a href= "page2.asp?DATA =<% server.URLEncod e(=RS("Value")) %>"><%
      > =RS("Value")%></a>
      >
      > *****
      >
      > Thanks
      > --
      > Thanks in advance
      >
      > Fawke
      >
      > Please remove ANTI and SPAM
      > from my email address before emailing me.
      >
      > www.bradflack.com
      >
      >[/color]


      Comment

      • Fawke101

        #4
        Re: Server.URLEncod e :-(

        OK,

        The apostrophy goes fine in the URL. But its when the next page tries to
        read it and issue a SELECT statement in accordance to this data that it all
        goes pear shaped.

        The select statement is as follows.

        ***
        Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
        VIEW1.COL3='" & request.queryst ring("Value") & "'")
        ***

        Even with the URL encode in the URL, the page still errors saying "Incorrect
        syntax near 'S'." the data in question is

        ---> "St Mathew's Park"

        Not all the data has an apostrophy, and this works, i just need a universal
        solution to make sure the data is ok (i dont fully understand how to
        encorporate a Replace function)
        Why isnt the URL Encode working in this case???

        --
        Thanks in advance

        Fawke

        Please remove ANTI and SPAM
        from my email address before emailing me.

        Servant of the most high God, empowered by the Holy Spirit, humbly following my savior Jesus Christ

        "Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
        message news:#hATcTQDEH A.1456@TK2MSFTN GP09.phx.gbl...[color=blue]
        > An apostrophe in a URL shouldn't matter. In what way, "aint it working?"
        > Do you get an error? What is the value of RS("Value")? What does your[/color]
        link[color=blue]
        > look like in a view source? When does the error occur? In what code does
        > the error occur?
        >
        > Ray at work
        >
        >
        > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
        > news:umz8YJQDEH A.2424@TK2MSFTN GP09.phx.gbl...[color=green]
        > > Hi there,
        > >
        > > I am having trouble with some data that is ripped from a SQL database[/color][/color]
        and[color=blue][color=green]
        > > displayed as a hyperlink.
        > > The hyperlink inserts the data into a querystring so the next page can[/color]
        > read[color=green]
        > > it.
        > >
        > > However, some of the data has apostrophies (') in it, so the page does[/color][/color]
        not[color=blue][color=green]
        > > redirect properly (invalid syntax) because of the apostrophy.
        > > so i tried to use the URL encode to get around this to no avail - it[/color]
        > doesnt[color=green]
        > > work.
        > > The hyperlink is as follows, is this correct - if so why aint it working
        > > :-( ? and is this the "best" way to get around this problem?
        > >
        > > *****
        > >
        > > <a href= "page2.asp?DATA =<% server.URLEncod e(=RS("Value")) %>"><%
        > > =RS("Value")%></a>
        > >
        > > *****
        > >
        > > Thanks
        > > --
        > > Thanks in advance
        > >
        > > Fawke
        > >
        > > Please remove ANTI and SPAM
        > > from my email address before emailing me.
        > >
        > > www.bradflack.com
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Aaron Bertrand [MVP]

          #5
          Re: Server.URLEncod e :-(

          You need to replace single quotes with two single quotes.


          --
          Aaron Bertrand
          SQL Server MVP



          "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
          news:OyWnkdQDEH A.2052@TK2MSFTN GP11.phx.gbl...[color=blue]
          > OK,
          >
          > The apostrophy goes fine in the URL. But its when the next page tries to
          > read it and issue a SELECT statement in accordance to this data that it[/color]
          all[color=blue]
          > goes pear shaped.
          >
          > The select statement is as follows.
          >
          > ***
          > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
          > VIEW1.COL3='" & request.queryst ring("Value") & "'")
          > ***
          >
          > Even with the URL encode in the URL, the page still errors saying[/color]
          "Incorrect[color=blue]
          > syntax near 'S'." the data in question is
          >
          > ---> "St Mathew's Park"
          >
          > Not all the data has an apostrophy, and this works, i just need a[/color]
          universal[color=blue]
          > solution to make sure the data is ok (i dont fully understand how to
          > encorporate a Replace function)
          > Why isnt the URL Encode working in this case???
          >
          > --
          > Thanks in advance
          >
          > Fawke
          >
          > Please remove ANTI and SPAM
          > from my email address before emailing me.
          >
          > www.bradflack.com
          > "Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
          > message news:#hATcTQDEH A.1456@TK2MSFTN GP09.phx.gbl...[color=green]
          > > An apostrophe in a URL shouldn't matter. In what way, "aint it[/color][/color]
          working?"[color=blue][color=green]
          > > Do you get an error? What is the value of RS("Value")? What does your[/color]
          > link[color=green]
          > > look like in a view source? When does the error occur? In what code[/color][/color]
          does[color=blue][color=green]
          > > the error occur?
          > >
          > > Ray at work
          > >
          > >
          > > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
          > > news:umz8YJQDEH A.2424@TK2MSFTN GP09.phx.gbl...[color=darkred]
          > > > Hi there,
          > > >
          > > > I am having trouble with some data that is ripped from a SQL database[/color][/color]
          > and[color=green][color=darkred]
          > > > displayed as a hyperlink.
          > > > The hyperlink inserts the data into a querystring so the next page can[/color]
          > > read[color=darkred]
          > > > it.
          > > >
          > > > However, some of the data has apostrophies (') in it, so the page does[/color][/color][/color]
          [color=blue]
          > not[color=green][color=darkred]
          > > > redirect properly (invalid syntax) because of the apostrophy.
          > > > so i tried to use the URL encode to get around this to no avail - it[/color]
          > > doesnt[color=darkred]
          > > > work.
          > > > The hyperlink is as follows, is this correct - if so why aint it[/color][/color][/color]
          working[color=blue][color=green][color=darkred]
          > > > :-( ? and is this the "best" way to get around this problem?
          > > >
          > > > *****
          > > >
          > > > <a href= "page2.asp?DATA =<% server.URLEncod e(=RS("Value")) %>"><%
          > > > =RS("Value")%></a>
          > > >
          > > > *****
          > > >
          > > > Thanks
          > > > --
          > > > Thanks in advance
          > > >
          > > > Fawke
          > > >
          > > > Please remove ANTI and SPAM
          > > > from my email address before emailing me.
          > > >
          > > > www.bradflack.com
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Fawke101

            #6
            Re: Server.URLEncod e :-(

            have "tried" to implement this before, but i cant get it to work, im not
            entirely sure where to put it (in the hyperlink or the SELECT statement???)

            How can i fit this into my code in order to ignore the apostrophy carried
            accross in the URL.

            sorry, i am new to ASP

            --
            Thanks in advance

            Fawke

            Please remove ANTI and SPAM
            from my email address before emailing me.

            Servant of the most high God, empowered by the Holy Spirit, humbly following my savior Jesus Christ

            "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
            news:eYwk6vQDEH A.3256@TK2MSFTN GP09.phx.gbl...[color=blue]
            > You need to replace single quotes with two single quotes.
            > http://www.aspfaq.com/2035
            >
            > --
            > Aaron Bertrand
            > SQL Server MVP
            > http://www.aspfaq.com/
            >
            >
            > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
            > news:OyWnkdQDEH A.2052@TK2MSFTN GP11.phx.gbl...[color=green]
            > > OK,
            > >
            > > The apostrophy goes fine in the URL. But its when the next page tries to
            > > read it and issue a SELECT statement in accordance to this data that it[/color]
            > all[color=green]
            > > goes pear shaped.
            > >
            > > The select statement is as follows.
            > >
            > > ***
            > > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
            > > VIEW1.COL3='" & request.queryst ring("Value") & "'")
            > > ***
            > >
            > > Even with the URL encode in the URL, the page still errors saying[/color]
            > "Incorrect[color=green]
            > > syntax near 'S'." the data in question is
            > >
            > > ---> "St Mathew's Park"
            > >
            > > Not all the data has an apostrophy, and this works, i just need a[/color]
            > universal[color=green]
            > > solution to make sure the data is ok (i dont fully understand how to
            > > encorporate a Replace function)
            > > Why isnt the URL Encode working in this case???
            > >
            > > --
            > > Thanks in advance
            > >
            > > Fawke
            > >
            > > Please remove ANTI and SPAM
            > > from my email address before emailing me.
            > >
            > > www.bradflack.com
            > > "Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
            > > message news:#hATcTQDEH A.1456@TK2MSFTN GP09.phx.gbl...[color=darkred]
            > > > An apostrophe in a URL shouldn't matter. In what way, "aint it[/color][/color]
            > working?"[color=green][color=darkred]
            > > > Do you get an error? What is the value of RS("Value")? What does[/color][/color][/color]
            your[color=blue][color=green]
            > > link[color=darkred]
            > > > look like in a view source? When does the error occur? In what code[/color][/color]
            > does[color=green][color=darkred]
            > > > the error occur?
            > > >
            > > > Ray at work
            > > >
            > > >
            > > > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
            > > > news:umz8YJQDEH A.2424@TK2MSFTN GP09.phx.gbl...
            > > > > Hi there,
            > > > >
            > > > > I am having trouble with some data that is ripped from a SQL[/color][/color][/color]
            database[color=blue][color=green]
            > > and[color=darkred]
            > > > > displayed as a hyperlink.
            > > > > The hyperlink inserts the data into a querystring so the next page[/color][/color][/color]
            can[color=blue][color=green][color=darkred]
            > > > read
            > > > > it.
            > > > >
            > > > > However, some of the data has apostrophies (') in it, so the page[/color][/color][/color]
            does[color=blue]
            >[color=green]
            > > not[color=darkred]
            > > > > redirect properly (invalid syntax) because of the apostrophy.
            > > > > so i tried to use the URL encode to get around this to no avail - it
            > > > doesnt
            > > > > work.
            > > > > The hyperlink is as follows, is this correct - if so why aint it[/color][/color]
            > working[color=green][color=darkred]
            > > > > :-( ? and is this the "best" way to get around this problem?
            > > > >
            > > > > *****
            > > > >
            > > > > <a href= "page2.asp?DATA =<% server.URLEncod e(=RS("Value")) %>"><%
            > > > > =RS("Value")%></a>
            > > > >
            > > > > *****
            > > > >
            > > > > Thanks
            > > > > --
            > > > > Thanks in advance
            > > > >
            > > > > Fawke
            > > > >
            > > > > Please remove ANTI and SPAM
            > > > > from my email address before emailing me.
            > > > >
            > > > > www.bradflack.com
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Peter Foti

              #7
              Re: Server.URLEncod e :-(

              "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
              news:O6PbS1QDEH A.3852@TK2MSFTN GP10.phx.gbl...[color=blue]
              > have "tried" to implement this before, but i cant get it to work, im not
              > entirely sure where to put it (in the hyperlink or the SELECT[/color]
              statement???)[color=blue]
              >
              > How can i fit this into my code in order to ignore the apostrophy carried
              > accross in the URL.[/color]

              Did you see my other post? The problem that I saw was that you had the
              equal sign in the wrong spot. Your code should looked like this:
              <a href=
              "page2.asp?DATA =<%=server.URLE ncode(RS("Value "))%>"><%=RS("V alue")%></a>

              And then on the page that processes it:
              Function sql_quote(str)
              sql_quote = Replace(str,"'" ,"''")
              End Function

              Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
              VIEW1.COL3='" & sql_quote(reque st.querystring( "Value")) & "'")

              Regards,
              Peter Foti


              Comment

              • Fawke101

                #8
                Re: Server.URLEncod e :-(

                that doesnt work tho, it completely ignores it and still generates a '
                i cant get this damn thing to work, its not your fault, im sure im 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 WHERE
                view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")

                'incorrect link looks like - St Mathew's - when clicked -

                <a href= "page2.asp?VALU E=<% =server.urlenco de(RS("value1") )%>"><%
                =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 WHERE
                view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
                *************** *
                and so on like that........... ..............


                Page 1 gets the data in accordance to what is selected from an initial list
                box, and displays the entries (inc. the one with the apostrophy). The link
                is clicked and goes to Page 2 and so on............

                Hope this clears it up a bit?
                --
                Thanks in advance

                Fawke

                Please remove ANTI and SPAM
                from my email address before emailing me.

                Servant of the most high God, empowered by the Holy Spirit, humbly following my savior Jesus Christ

                "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in message
                news:105jni9bo4 69d00@corp.supe rnews.com...[color=blue]
                > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                > news:O6PbS1QDEH A.3852@TK2MSFTN GP10.phx.gbl...[color=green]
                > > have "tried" to implement this before, but i cant get it to work, im not
                > > entirely sure where to put it (in the hyperlink or the SELECT[/color]
                > statement???)[color=green]
                > >
                > > How can i fit this into my code in order to ignore the apostrophy[/color][/color]
                carried[color=blue][color=green]
                > > accross in the URL.[/color]
                >
                > Did you see my other post? The problem that I saw was that you had the
                > equal sign in the wrong spot. Your code should looked like this:
                > <a href=
                > "page2.asp?DATA =<%=server.URLE ncode(RS("Value "))%>"><%=RS("V alue")%></a>
                >
                > And then on the page that processes it:
                > Function sql_quote(str)
                > sql_quote = Replace(str,"'" ,"''")
                > End Function
                >
                > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
                > VIEW1.COL3='" & sql_quote(reque st.querystring( "Value")) & "'")
                >
                > Regards,
                > Peter Foti
                >
                >[/color]


                Comment

                • Aaron Bertrand [MVP]

                  #9
                  Re: Server.URLEncod e :-(

                  You know what? You would reduce a lot of complexity by using primary keys
                  such as a numeric identifier and passing them from page to page. I'm going
                  in circles here trying to figure out where you're losing the repeated
                  apostrophe. This wouldn't happen with numbers.

                  --
                  Aaron Bertrand
                  SQL Server MVP



                  "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                  news:ejFaFVRDEH A.2600@TK2MSFTN GP09.phx.gbl...[color=blue]
                  > that doesnt work tho, it completely ignores it and still generates a '
                  > i cant get this damn thing to work, its not your fault, im sure im 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 WHERE
                  > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
                  >
                  > 'incorrect link looks like - St Mathew's - when clicked -
                  >
                  > <a href= "page2.asp?VALU E=<% =server.urlenco de(RS("value1") )%>"><%
                  > =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 WHERE
                  > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
                  > *************** *
                  > and so on like that........... ..............
                  >
                  >
                  > Page 1 gets the data in accordance to what is selected from an initial[/color]
                  list[color=blue]
                  > box, and displays the entries (inc. the one with the apostrophy). The link
                  > is clicked and goes to Page 2 and so on............
                  >
                  > Hope this clears it up a bit?
                  > --
                  > Thanks in advance
                  >
                  > Fawke
                  >
                  > Please remove ANTI and SPAM
                  > from my email address before emailing me.
                  >
                  > www.bradflack.com
                  > "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in message
                  > news:105jni9bo4 69d00@corp.supe rnews.com...[color=green]
                  > > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                  > > news:O6PbS1QDEH A.3852@TK2MSFTN GP10.phx.gbl...[color=darkred]
                  > > > have "tried" to implement this before, but i cant get it to work, im[/color][/color][/color]
                  not[color=blue][color=green][color=darkred]
                  > > > entirely sure where to put it (in the hyperlink or the SELECT[/color]
                  > > statement???)[color=darkred]
                  > > >
                  > > > How can i fit this into my code in order to ignore the apostrophy[/color][/color]
                  > carried[color=green][color=darkred]
                  > > > accross in the URL.[/color]
                  > >
                  > > Did you see my other post? The problem that I saw was that you had the
                  > > equal sign in the wrong spot. Your code should looked like this:
                  > > <a href=
                  > > "page2.asp?DATA =<%=server.URLE ncode(RS("Value "))%>"><%=RS("V alue")%></a>
                  > >
                  > > And then on the page that processes it:
                  > > Function sql_quote(str)
                  > > sql_quote = Replace(str,"'" ,"''")
                  > > End Function
                  > >
                  > > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
                  > > VIEW1.COL3='" & sql_quote(reque st.querystring( "Value")) & "'")
                  > >
                  > > Regards,
                  > > Peter Foti
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  • Fawke101

                    #10
                    Re: Server.URLEncod e :-(

                    I agree, however i didnt design the database and it would be imposible now
                    to enforce such a move. I appreciate your help on this and you're right, it
                    would be alot easier to use numbers. Not possible though, All i want to do
                    is remove the bloody thing !!! :-(

                    Sorry and thanks again

                    --
                    Thanks in advance

                    Fawke

                    Please remove ANTI and SPAM
                    from my email address before emailing me.

                    Servant of the most high God, empowered by the Holy Spirit, humbly following my savior Jesus Christ

                    "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
                    news:Oyn4FYRDEH A.2564@TK2MSFTN GP11.phx.gbl...[color=blue]
                    > You know what? You would reduce a lot of complexity by using primary keys
                    > such as a numeric identifier and passing them from page to page. I'm[/color]
                    going[color=blue]
                    > in circles here trying to figure out where you're losing the repeated
                    > apostrophe. This wouldn't happen with numbers.
                    >
                    > --
                    > Aaron Bertrand
                    > SQL Server MVP
                    > http://www.aspfaq.com/
                    >
                    >
                    > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                    > news:ejFaFVRDEH A.2600@TK2MSFTN GP09.phx.gbl...[color=green]
                    > > that doesnt work tho, it completely ignores it and still generates a '
                    > > i cant get this damn thing to work, its not your fault, im sure im 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 WHERE
                    > > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
                    > >
                    > > 'incorrect link looks like - St Mathew's - when clicked -
                    > >
                    > > <a href= "page2.asp?VALU E=<% =server.urlenco de(RS("value1") )%>"><%
                    > > =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 WHERE
                    > > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
                    > > *************** *
                    > > and so on like that........... ..............
                    > >
                    > >
                    > > Page 1 gets the data in accordance to what is selected from an initial[/color]
                    > list[color=green]
                    > > box, and displays the entries (inc. the one with the apostrophy). The[/color][/color]
                    link[color=blue][color=green]
                    > > is clicked and goes to Page 2 and so on............
                    > >
                    > > Hope this clears it up a bit?
                    > > --
                    > > Thanks in advance
                    > >
                    > > Fawke
                    > >
                    > > Please remove ANTI and SPAM
                    > > from my email address before emailing me.
                    > >
                    > > www.bradflack.com
                    > > "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in[/color][/color]
                    message[color=blue][color=green]
                    > > news:105jni9bo4 69d00@corp.supe rnews.com...[color=darkred]
                    > > > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                    > > > news:O6PbS1QDEH A.3852@TK2MSFTN GP10.phx.gbl...
                    > > > > have "tried" to implement this before, but i cant get it to work, im[/color][/color]
                    > not[color=green][color=darkred]
                    > > > > entirely sure where to put it (in the hyperlink or the SELECT
                    > > > statement???)
                    > > > >
                    > > > > How can i fit this into my code in order to ignore the apostrophy[/color]
                    > > carried[color=darkred]
                    > > > > accross in the URL.
                    > > >
                    > > > Did you see my other post? The problem that I saw was that you had[/color][/color][/color]
                    the[color=blue][color=green][color=darkred]
                    > > > equal sign in the wrong spot. Your code should looked like this:
                    > > > <a href=
                    > > >[/color][/color][/color]
                    "page2.asp?DATA =<%=server.URLE ncode(RS("Value "))%>"><%=RS("V alue")%></a>[color=blue][color=green][color=darkred]
                    > > >
                    > > > And then on the page that processes it:
                    > > > Function sql_quote(str)
                    > > > sql_quote = Replace(str,"'" ,"''")
                    > > > End Function
                    > > >
                    > > > Set RS = DataConnection. Execute("SELECT COL1, COL2 FROM VIEW1 WHERE
                    > > > VIEW1.COL3='" & sql_quote(reque st.querystring( "Value")) & "'")
                    > > >
                    > > > Regards,
                    > > > Peter Foti
                    > > >
                    > > >[/color]
                    > >
                    > >[/color]
                    >
                    >[/color]


                    Comment

                    • Peter Foti

                      #11
                      Re: Server.URLEncod e :-(

                      "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                      news:ejFaFVRDEH A.2600@TK2MSFTN GP09.phx.gbl...[color=blue]
                      > that doesnt work tho, it completely ignores it and still generates a '
                      > i cant get this damn thing to work, its not your fault, im sure im 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 WHERE
                      > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
                      >
                      > 'incorrect link looks like - St Mathew's - when clicked -
                      >
                      > <a href= "page2.asp?VALU E=<% =server.urlenco de(RS("value1") )%>"><%
                      > =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 WHERE
                      > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
                      > *************** *
                      > and so on like that........... ..............[/color]


                      You're making this difficult to debug... which is the correct querystring
                      variable name, "value" or "value1"? On page1.asp you called it "value" and
                      on page 2 you are trying to reference "value1". In addition, you used the
                      fieldnames "COL1" and "COL2" in the query above that. WHICH IS IT??? Also,
                      your query on page2.asp is pulling from table "view2", but using a value
                      from "view1"???? Are these cut and paste errors?

                      Peter
                      PS- Odd naming convention (giving the sql_quote function all uppercase
                      letters... very strange).


                      Comment

                      • Aaron Bertrand [MVP]

                        #12
                        Re: Server.URLEncod e :-(

                        I think if Fawke101 were to use real column/parameter names instead of
                        kludging it up with this COL1/COL2 nonsense we'd get to the bottom of this a
                        lot quicker.

                        --
                        Aaron Bertrand
                        SQL Server MVP



                        "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in message
                        news:105jum4k6j 5jb6e@corp.supe rnews.com...[color=blue]
                        > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                        > news:ejFaFVRDEH A.2600@TK2MSFTN GP09.phx.gbl...[color=green]
                        > > that doesnt work tho, it completely ignores it and still generates a '
                        > > i cant get this damn thing to work, its not your fault, im sure im 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 WHERE
                        > > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
                        > >
                        > > 'incorrect link looks like - St Mathew's - when clicked -
                        > >
                        > > <a href= "page2.asp?VALU E=<% =server.urlenco de(RS("value1") )%>"><%
                        > > =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 WHERE
                        > > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
                        > > *************** *
                        > > and so on like that........... ..............[/color]
                        >
                        >
                        > You're making this difficult to debug... which is the correct querystring
                        > variable name, "value" or "value1"? On page1.asp you called it "value"[/color]
                        and[color=blue]
                        > on page 2 you are trying to reference "value1". In addition, you used the
                        > fieldnames "COL1" and "COL2" in the query above that. WHICH IS IT???[/color]
                        Also,[color=blue]
                        > your query on page2.asp is pulling from table "view2", but using a value
                        > from "view1"???? Are these cut and paste errors?
                        >
                        > Peter
                        > PS- Odd naming convention (giving the sql_quote function all uppercase
                        > letters... very strange).
                        >
                        >[/color]


                        Comment

                        • Fawke101

                          #13
                          Re: Server.URLEncod e :-(

                          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 put
                          into a querystring in order for page2.asp (which gets its data from ANOTHER
                          view - view2) to proccess the data.
                          I will paste my code up here without the naming ammendments, just thought
                          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.

                          Servant of the most high God, empowered by the Holy Spirit, humbly following my savior Jesus Christ

                          "Aaron Bertrand [MVP]" <aaron@TRASHasp faq.com> wrote in message
                          news:ei8lJuSDEH A.3404@TK2MSFTN GP10.phx.gbl...[color=blue]
                          > I think if Fawke101 were to use real column/parameter names instead of
                          > kludging it up with this COL1/COL2 nonsense we'd get to the bottom of this[/color]
                          a[color=blue]
                          > lot quicker.
                          >
                          > --
                          > Aaron Bertrand
                          > SQL Server MVP
                          > http://www.aspfaq.com/
                          >
                          >
                          > "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in message
                          > news:105jum4k6j 5jb6e@corp.supe rnews.com...[color=green]
                          > > "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                          > > news:ejFaFVRDEH A.2600@TK2MSFTN GP09.phx.gbl...[color=darkred]
                          > > > that doesnt work tho, it completely ignores it and still generates a '
                          > > > i cant get this damn thing to work, its not your fault, im sure im[/color][/color][/color]
                          doing[color=blue][color=green][color=darkred]
                          > > > 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 WHERE
                          > > > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
                          > > >
                          > > > 'incorrect link looks like - St Mathew's - when clicked -
                          > > >
                          > > > <a href= "page2.asp?VALU E=<% =server.urlenco de(RS("value1") )%>"><%
                          > > > =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 WHERE
                          > > > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
                          > > > *************** *
                          > > > and so on like that........... ..............[/color]
                          > >
                          > >
                          > > You're making this difficult to debug... which is the correct[/color][/color]
                          querystring[color=blue][color=green]
                          > > variable name, "value" or "value1"? On page1.asp you called it "value"[/color]
                          > and[color=green]
                          > > on page 2 you are trying to reference "value1". In addition, you used[/color][/color]
                          the[color=blue][color=green]
                          > > fieldnames "COL1" and "COL2" in the query above that. WHICH IS IT???[/color]
                          > Also,[color=green]
                          > > your query on page2.asp is pulling from table "view2", but using a value
                          > > from "view1"???? Are these cut and paste errors?
                          > >
                          > > Peter
                          > > PS- Odd naming convention (giving the sql_quote function all uppercase
                          > > letters... very strange).
                          > >
                          > >[/color]
                          >
                          >[/color]


                          Comment

                          • Fawke101

                            #14
                            Re: Server.URLEncod e :-(

                            Note i havent implemented the function or the Server URLEncode because it
                            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") & "'")
                            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, income
                            FROM vw_Summary_Mana ger WHERE vw_Summary_Mana ger.manager='" &
                            request.queryst ring("manager") & "'")
                            do until RS.EOF

                            <a href=
                            "summary_assist ant_manager.asp ?assistant_mana ger=<%=RS("assi stant_manager") %[color=blue]
                            >"><% =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. data is
                            arranged in accordance to the selection. A list of managers are listed for
                            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 for
                            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.

                            Servant of the most high God, empowered by the Holy Spirit, humbly following my savior Jesus Christ

                            "Fawke101" <guy@ANTIbradfl ack.SPAMcom> wrote in message
                            news:#Ev60sUDEH A.3692@tk2msftn gp13.phx.gbl...[color=blue]
                            > 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 put
                            > into a querystring in order for page2.asp (which gets its data from[/color]
                            ANOTHER[color=blue]
                            > view - view2) to proccess the data.
                            > I will paste my code up here without the naming ammendments, just thought
                            > 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...[color=green]
                            > > I think if Fawke101 were to use real column/parameter names instead of
                            > > kludging it up with this COL1/COL2 nonsense we'd get to the bottom of[/color][/color]
                            this[color=blue]
                            > a[color=green]
                            > > lot quicker.
                            > >
                            > > --
                            > > Aaron Bertrand
                            > > SQL Server MVP
                            > > http://www.aspfaq.com/
                            > >
                            > >
                            > > "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in[/color][/color]
                            message[color=blue][color=green]
                            > > news:105jum4k6j 5jb6e@corp.supe rnews.com...[color=darkred]
                            > > > "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 generates a[/color][/color][/color]
                            '[color=blue][color=green][color=darkred]
                            > > > > i cant get this damn thing to work, its not your fault, im sure im[/color][/color]
                            > doing[color=green][color=darkred]
                            > > > > 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 WHERE
                            > > > > view1.COL3='" & SQL_QUOTE(sessi on("lstbox")) & "'")
                            > > > >
                            > > > > 'incorrect link looks like - St Mathew's - when clicked -
                            > > > >
                            > > > > <a href= "page2.asp?VALU E=<% =server.urlenco de(RS("value1") )%>"><%
                            > > > > =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 WHERE
                            > > > > view1.COL3='" & SQL_QUOTE(reque st.querystring( "value1")) & "'")
                            > > > > *************** *
                            > > > > and so on like that........... ..............
                            > > >
                            > > >
                            > > > You're making this difficult to debug... which is the correct[/color][/color]
                            > querystring[color=green][color=darkred]
                            > > > variable name, "value" or "value1"? On page1.asp you called it[/color][/color][/color]
                            "value"[color=blue][color=green]
                            > > and[color=darkred]
                            > > > on page 2 you are trying to reference "value1". In addition, you used[/color][/color]
                            > the[color=green][color=darkred]
                            > > > fieldnames "COL1" and "COL2" in the query above that. WHICH IS IT???[/color]
                            > > Also,[color=darkred]
                            > > > your query on page2.asp is pulling from table "view2", but using a[/color][/color][/color]
                            value[color=blue][color=green][color=darkred]
                            > > > from "view1"???? Are these cut and paste errors?
                            > > >
                            > > > Peter
                            > > > PS- Odd naming convention (giving the sql_quote function all uppercase
                            > > > letters... very strange).
                            > > >
                            > > >[/color]
                            > >
                            > >[/color]
                            >
                            >[/color]


                            Comment

                            • Randy Rahbar

                              #15
                              Re: Server.URLEncod e :-(

                              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=blue]
                              > Note i havent implemented the function or the Server URLEncode because it
                              > 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") & "'")
                              > 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=blue]
                              > FROM vw_Summary_Mana ger WHERE vw_Summary_Mana ger.manager='" &
                              > request.queryst ring("manager") & "'")
                              > do until RS.EOF
                              >
                              > <a href=
                              >[/color]
                              "summary_assist ant_manager.asp ?assistant_mana ger=<%=RS("assi stant_manager") %[color=blue][color=green]
                              > >"><% =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. data[/color]
                              is[color=blue]
                              > arranged in accordance to the selection. A list of managers are listed for
                              > 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=blue]
                              > 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=green]
                              > > 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=blue][color=green]
                              > > into a querystring in order for page2.asp (which gets its data from[/color]
                              > ANOTHER[color=green]
                              > > view - view2) to proccess the data.
                              > > I will paste my code up here without the naming ammendments, just[/color][/color]
                              thought[color=blue][color=green]
                              > > 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...[color=darkred]
                              > > > I think if Fawke101 were to use real column/parameter names instead of
                              > > > kludging it up with this COL1/COL2 nonsense we'd get to the bottom of[/color][/color]
                              > this[color=green]
                              > > a[color=darkred]
                              > > > lot quicker.
                              > > >
                              > > > --
                              > > > Aaron Bertrand
                              > > > SQL Server MVP
                              > > > http://www.aspfaq.com/
                              > > >
                              > > >
                              > > > "Peter Foti" <peter@Idontwan tnostinkingemai lfromyou.com> wrote in[/color][/color]
                              > message[color=green][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 generates[/color][/color][/color]
                              a[color=blue]
                              > '[color=green][color=darkred]
                              > > > > > i cant get this damn thing to work, its not your fault, im sure im[/color]
                              > > doing[color=darkred]
                              > > > > > 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][/color]
                              WHERE[color=blue][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=<% =server.urlenco de(RS("value1") )%>"><%
                              > > > > > =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][/color]
                              WHERE[color=blue][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[/color]
                              > > querystring[color=darkred]
                              > > > > variable name, "value" or "value1"? On page1.asp you called it[/color][/color]
                              > "value"[color=green][color=darkred]
                              > > > and
                              > > > > on page 2 you are trying to reference "value1". In addition, you[/color][/color][/color]
                              used[color=blue][color=green]
                              > > the[color=darkred]
                              > > > > fieldnames "COL1" and "COL2" in the query above that. WHICH IS[/color][/color][/color]
                              IT???[color=blue][color=green][color=darkred]
                              > > > Also,
                              > > > > your query on page2.asp is pulling from table "view2", but using a[/color][/color]
                              > value[color=green][color=darkred]
                              > > > > from "view1"???? Are these cut and paste errors?
                              > > > >
                              > > > > Peter
                              > > > > PS- Odd naming convention (giving the sql_quote function all[/color][/color][/color]
                              uppercase[color=blue][color=green][color=darkred]
                              > > > > letters... very strange).
                              > > > >
                              > > > >
                              > > >
                              > > >[/color]
                              > >
                              > >[/color]
                              >
                              >[/color]


                              Comment

                              Working...