Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2004
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP show mdb help!!

    I am trying to display my mdb database in the browser. The data is rendered into a table, however I am having a problem with a small bit of code.

    Here is the code, this is not working for me:

    Code:
    <a href="update_form.asp?ID=" & "<%=rsHotelblock(("ID_no"))%>"><%=rsHotelblock("Hotel")%></a>
    I want to autogenerate the link with column ID_no which references column Hotel as the link displayed. Final html should look like this:

    <a href="update_form.asp?ID=1>Hotel Name</a>

    but the code block above renders as
    <a 1="" &="" href="update_form.asp?ID=">Hotel</a>

    Can someone please show what I'm doing wrong?

    Thanks!!!!!

  • #2
    Regular Coder
    Join Date
    May 2007
    Location
    UK
    Posts
    180
    Thanks
    0
    Thanked 18 Times in 18 Posts
    It's the old quotes in quotes problem. Try:

    Code:
     
    <a href='update_form.asp?ID="<%=rsHotelblock("ID_no")%>'><%=rsHotelblock("Hotel")%></a>
    

  • #3
    New Coder
    Join Date
    Aug 2004
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the help, works great!!

  • #4
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Not to deter from what Southwater said, but you can also do it this way:

    Code:
    <a href="update_form.asp?ID=<%=rsHotelblock(("ID_no"))%>"><%=rsHotelblock("Hotel")%></a>
    You don't need to do a second set of quotes to get this to work.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #5
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    You can also escape the quotes with 2 quotes instead of one when inside a string
    Code:
    "<a href=""update_form.asp?ID=" & rsHotelblock("ID_no")& """>" & rsHotelblock("Hotel") & "</a>"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •