Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2004, 07:53 AM
Authorized User
 
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing a querystring value that contains '&'

Hi,

How can I pass a querystring value that contains an & ?

I have it enclosed in quotes, which I thought would prevent problems.

I'm reading the information from a database - the actual line of code is:

<a href='ViewItem.asp?Category="BookCdDvd"&Item="<%= objRS("Item") %>"'><%= objRS("Item") %></a>


When I rest the mouse over the link, this is what's displayed in the status bar :

ViewItem?Category="BookCdDvd"&Item="Masked & Anonymous"


It keeps stopping at the &, and giving me this error :

Microsoft JET Database Engine (0x80040E14)
Syntax error in string in query expression 'Item = "Masked'.

Any suggestions?

Thanks,
Jennie.

 
Old November 10th, 2004, 08:01 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Jennie,

You need to use Server.URLEncode() for parameters in the querystring that can contain problem characters, not enclose them in quotes.

HTH,

Chris
 
Old November 10th, 2004, 08:05 AM
Authorized User
 
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Chris - you're a star!

The only fly in the ointment has been eliminated.

Thanks,
Jennie.

 
Old March 20th, 2006, 09:27 PM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to terrydashley Send a message via MSN to terrydashley Send a message via Yahoo to terrydashley
Default

In the event I want to pass a value pulled from a database or cookie in a URL query string, as mentioned on this page, but don't want to show the querystring on the next page, how would I go about accomplishing this?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing data via querystring LanceRoss Beginning VB 6 3 July 25th, 2008 12:20 PM
passing password in in querystring jaya929 ASP.NET 2.0 Professional 5 May 27th, 2008 07:47 AM
Passing more than one querystring in the site map kaushikpulpa ASP.NET 2.0 Basics 1 April 20th, 2007 08:08 AM
Passing URL in a Querystring [email protected] Javascript How-To 3 July 8th, 2004 04:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.