Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 10th, 2004, 07:53 AM
Authorized User
 
Join Date: Jul 2004
Location: , , Ireland.
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.

Reply With Quote
  #2 (permalink)  
Old November 10th, 2004, 08:01 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
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
Reply With Quote
  #3 (permalink)  
Old November 10th, 2004, 08:05 AM
Authorized User
 
Join Date: Jul 2004
Location: , , Ireland.
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.

Reply With Quote
  #4 (permalink)  
Old March 20th, 2006, 09:27 PM
Registered User
 
Join Date: Mar 2006
Location: Tacoma, WA, USA.
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?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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 hugh@kmcnetwork.com Javascript How-To 3 July 8th, 2004 04:59 PM



All times are GMT -4. The time now is 03:11 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.